Custom Inventory

Discussion in 'Plugin Development' started by nikosdial, Jun 29, 2015.

Thread Status:
Not open for further replies.
  1. I am new to java and i have some basic knowledge on how to create a plugin so I do not know a lot of stuff. I was wondering if it is possible when someone is pressing E (the button) it would open a custom inventory instead of the normal one. I have learned that you can open custom inventories by clicking a block or the air by typing (e.getAction() == Action.LEFT_CLICK_AIR)) return; (it depends on where you want the player to click) . So if it is possible for a player to open a custom inventory by pressing E is it possible to do so with getAction ??
     
  2. InventoryOpenEvent. Check if the inventory is the players inventory, then cancel and open your custom inventory
     
    nikosdial and CraftBang like this.
  3. @FisheyLP Thanks a lot! I'll try to find out where to put it though :p because i'm new i'm still trying to figure things out a bit... But thanks for the reply and now tha i know that it can be done i'll find a way :)
     
  4. Offline

    JuicyDev

    Pretty sure that doesn't call for the player opening their own inventory.
     
    Last edited: Jun 29, 2015
  5. Offline

    JuicyDev

    It calls when inventories are opened, but they player's own inventory doesn't count for that.
     
  6. @JuicyDev So when one player opens his inventory a custom inventory would pop up to everyone?
     
  7. Offline

    JuicyDev

    No. If a player opens a chest for example to open inventory event fires. Or if a plugin makes a player open an inventory the event will fire. But I am pretty sure that the event does not fire when a player hits E (or whatever inventory keybind they have) to open their inventory.
     
  8. @JuicyDev oh... do you know if it is possible to triger the event when the player hits E? If so.. could you tell me how?
     
  9. Offline

    JuicyDev

    You don't trigger the events, they are passed through the Bukkit API to you.
     
  10. Offline

    JuicyDev

    Almost certain it isn't even with ProtocolLib etc.
     
Thread Status:
Not open for further replies.

Share This Page