Check when player equips armour

Discussion in 'Spigot Plugin Development' started by Creepermanthe3rd, May 31, 2016.

  1. Hello I was wondering how can I can test if a player equipts armour

    So, if a player puts on any type of boots and they have the lore ChatColor.GREEN, ChatColor.BOLD + "Gears I"

    It will give them permanent Speed 1 until they remove the boots!

    EDIT: Can anyone pls tel me the code for this @ItsMonkey
     
    #1 Creepermanthe3rd, May 31, 2016
    Last edited: May 31, 2016
  2. You should have an event for this. Or you can always just check every second if a player has armor and do it that way.

    If you just want to add speed. There are also tags you can use to set the speed for when you have them equipped
     
  3. PlayerInteractEvent
    InventoryClickEvent
     
    • Agree Agree x 1
  4. @ItsMonkey Can you give me the code for how I would do that pls?
     

  5. #PlayerInteractEvent
    • Check for the interaction and click type a player makes on a specific item
    • Check to make sure the player currently doesn't have the armor slot equipped with another item
    • Have conditions for the material clicked (i.e ItemMeta)
    • Apply your modifications

    #InventoryClickEvent
    • Check for the player's inventory type
    • Check for the click type to determine if player equipped/unequipped an item from their armor slot
    • Have conditions for the material clicked (i.e ItemMeta)
    • Apply your modifications
     
    • Agree Agree x 1