How to item clicked on

Discussion in 'Plugin Development' started by zakarls, Jul 9, 2014.

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

    zakarls

    When a player puts an item in their armor slot. I want to check what that item is so im able to determine if the player is the right level to put the armor on. How would I go about doing this? Thanks
     
  2. Offline

    THEREDBARON24

    Code:java
    1. @EventHandler
    2. public void onClick(InventoryClickEvent event){
    3. if(event.getSlotType().equals(SlotType.ARMOR)){
    4. ItemStack stack = new ItemStack(event.getCursor().getType());
    5. }
    6. }

    Try this, if getCursor is not correct, then use current Item. Not sure how well this will handle null items, so you may have to add checks to that.
     
Thread Status:
Not open for further replies.

Share This Page