Solved Change inventory size without creating a new inventory

Discussion in 'Plugin Development' started by Max8801, Sep 16, 2016.

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

    Max8801

    Hey guys,
    I wonder if it would be possible to change the size of a custom inventory while a player is looking at it. The problem with creating a new one and opening it for the player is, that the mouse cursor get's moved to the center of the screen.

    Can anyone help?

    Regards, Max
     
  2. Offline

    BeastyBoo

    Hey! maybe this could help you: http://stackoverflow.com/questions/20985517/create-a-custom-inventory-in-bukkit
     
  3. Offline

    Zombie_Striker

    @Max8801
    Nope. You cannot change an inventory while it is being viewed. You can, however, "block off" slots so that the player cannot access them. After that, change those individual slots if you want to expand the inventory.
     
  4. Offline

    Max8801

    But how does SoulPvP.de manage to do it? Just use /shop and try yourself

    Thanks, but I know how to create a virtual inventory :D
    My question is how I can change the size of the inventory after the inventory object was created. As mentioned above, the server SoulPvP managed to do that
     
  5. Offline

    Jakeeeee

    They open another inventory?
     
    Zombie_Striker likes this.
  6. Offline

    Max8801

    Wow. Thanks. I'm feeling so dumb now. I cant remember why and when but I added player.closeInventory() before I opened the new one. Of course that centers the cursor. Thank you all for your Replys. I apalogize for my dumbness :D
     
Thread Status:
Not open for further replies.

Share This Page