Check if player's inventory is open

Discussion in 'Plugin Development' started by Warreo, Aug 14, 2012.

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

    Warreo

    I would like to know how to check to see if a player's inventory is open, and if so how to close it. I know this seems simple and probably is I just can't think of how to do it. Thank You Guys!:D
     
  2. Offline

    RingOfStorms

    ATM there is no way to close a player's inventory, it may be a bug or something but it seems it is only client side. If you want you can store a list of who has it open by doing the playeropeninvetory event or something like that.
     
  3. Offline

    Warreo

    Thank You, but the problem I had was; when a player picked up an item normally in Minecraft it would convert it (part of the plugin I'm coding) thus it would remove the item from the player's inventory, which it did do. But there is a bug so that if a player has their inventory open and dropped the item, when it was picked up it wouldn't be removed.
     
  4. Offline

    keensta

    Player target = Bukkit.getPlayerExact(args[0]);
    target.closeInventory();

    Not sure if it actully works but its there. :p. also you mention the is a bug in your plugin. You want to remove pick ups? Is that what you are trying to do could you explain a bit more. Because if you want to disable certain pick ups you could just make it so the player can not pick up the item to begin with. Also possibly delete the item on the attempt of picking it up. Rather then waiting for it to be picked up then attempting to do it.
     
  5. Offline

    RingOfStorms

    I do believe that is client side if they relog does it still stay there? And even if they don't relog can they use the item?
    @Warreo
     
  6. Offline

    Warreo

    I realized that the problem was accruing more often than not and is probably an error with my remove item. I'm working on the code ATM to try and fix it so it works more functionally.
     
Thread Status:
Not open for further replies.

Share This Page