Inventory w/out player inventory.

Discussion in 'Plugin Development' started by Dai_Kunai, Feb 19, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    Dai_Kunai

    I got a quick question. Is there a way to create an Inventory using

    Code:
    Bukkit.createInventory(null, 45, "My GUI");
    without having it also include the player inventory below the inventory I created. I know it can be done by using the inventoryview chest view but after doing that I don't think you can change the number of rows. Is it possible? Do any big servers such as Mineplex and Hypixel have more rows, or is it only double and/or singlechest sizes (27,54 or 3rows,6rows).

    Thanks for reading! :D
     
  2. Offline

    The_Spaceman

    you can use any number that is dividable by 9 (9, 18, 27, etc).
    And as far as I know you can't edit the chest view
     
  3. Offline

    Tabuu_

  4. Offline

    Dai_Kunai

    Yeah, but after I do a chest view, can I change it so it's 5 rows? That's what I was wondering...
     
  5. Offline

    Colinus999

    No. You would have to open a new Inventory with 5*9 slots. But you can of course copy all the items from one inventory to the other by looping throught the getItems() of the first inventory.
     
  6. Offline

    Chr0mosom3

    @Eccentric_Gamer, I don't really understand you so I am just going to give multiple answers to multiple questions.

    1. No, you can't have 45 rows...
    2. If you want 5 rows then just do 5 * 9 as @Colinus999 said above
    3. If you want 5 columns then you could just make all the rows on the sides have all the items filled with red stained glass.

    A quick formula you can use is this:
    Code:
    Bukkit.createInventory(null, rows * 9, "My GUI");
    
    Change rows to the number of rows you want, it can be anything up to 6 rows I think...

    ----------------------------

    If this has helped you mark this thread as solved
     
  7. I assume you are annoyed by the player inventory displaying every time a chest is opened, and want to create an inventory that does not include the player inventory. I do not believe that is possible.
     
    Dai_Kunai likes this.
  8. Offline

    Dai_Kunai

    Yeah, that's basically what I was asking. Do all of the big servers just use 3 row InventoryType.CHEST inventories, because those don't have the player inventory underneath them? I don't remember nor do I have time to go and check on Hypixel (or rather I can't right now). If that's the case then that is what I will do.
     
Thread Status:
Not open for further replies.

Share This Page