Inventory Problems

Discussion in 'Plugin Development' started by sharp237, Sep 25, 2013.

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

    sharp237

    I am creating an inventory gui, however, with my inventory gui every time a player switches 'pages' their previous inventory has to be closed and a new one opened. Because of this, their cursor gets reset to the middle of the screen.__________________________________________________________
    To fix this, I could simply just change the contents of their inventory, but I want to also change the inventory's title and this can only be done by changing the whole inventory. I was wondering if there is some way to resolve this issue, perhaps by using packets to trick the player's client into thinking their inventory never closed?
    Thanks :)
     
  2. Offline

    chasechocolate

    player.openInventory(inv) returns an InventoryView from which you can change the title, size, etc.
     
  3. Offline

    sharp237


    May be wrong, but just checked and InventoryView doesn't have like a .setTitle("title") function?
     
  4. Offline

    chasechocolate

    sharp237 oh my bad, I guess not then :/
     
  5. Offline

    JavaGuava

    Maybe if you stop the closeinventory packet being sent to the client it may work?
     
  6. Offline

    sharp237


    How would I do that? And, does the client close & re-open a new inventory even if you stop that packet?
     
  7. Offline

    Janmm14

    sharp237
    Packet things done with ProtocolLib (see bukkitdev) and http://wiki.vg/Protocol
    I don't know whter the client reopens or crashes if it recieves open inventory packet while it is open. Just try it out.
     
Thread Status:
Not open for further replies.

Share This Page