1.15.2 ArmorEquipEvent

Discussion in 'Spigot Plugin Development' started by He-light, Feb 18, 2020.

  1. What is the best solution, to listen, if a player equips armor?
     
  2. i currently just use spigot, would you recommend to use paper?
     
  3. Yeah, but you should not post any Paper-only plugins/resources here on SpigotMC.
     
    • Like Like x 1
  4. Like i said, i currently use spigot^^ So any suggestions for Spigot?
     
    #6 He-light, Feb 18, 2020
    Last edited: Feb 18, 2020
  5. Use the armor equip event plugin. If you want to use it without needing to install it as a plugin, you can shade it into the jar using Maven if you register the listeners yourself.
     
  6. i have some trouble, using this LIB: Plugin ... has failed to register events ... because com/codingforcookies/armorequip/ArmorEquipEvent does not exist.

    this is my pseudo code:
    Code (Java):

    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import com.codingforcookies.armorequip.ArmorEquipEvent;
    public class CustomGearListener implements Listener{
     
        public CustomGearListener() {
            // TODO Auto-generated constructor stub
        }
     
        @EventHandler
        public void onArmorEquip(ArmorEquipEvent e) {
            Bukkit.broadcastMessage("TEST");
        }
         

    }
     
  7. drives_a_ford

    Moderator

    You need to add the ArmorEquipEvent plugin to your server's plugins folder and make sure that it loads before your plugin. For the latter, you'll want to add it as a dependency in your plugin.yml.
     
  8. Thanks!!