[LIB] ArmorEquipEvent 1.6.5

A basic event thats called when players equip and unequip armor

  1. Borlea
    Tested Minecraft Versions:
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    Contributors:
    Borlea
    This is just a simple plugin that calls an event when players equip and unequip armor.

    You can either just add this plugin as a dependency in the plugin yml and add it to your Libraries, or grab the needed methods and Class from the github page and insert it into your plugin. (Make sure when you grab the events you are registering them). The event is just named ArmorEquipEvent.

    This plugin doesn't support equipping or unequipping of armor on mobs.

    The github page is available here.
    A 1.7.1 beta build is available here. Suggested if you're on 1.13

    If you have any questions please do ask via pm or just reply to the resource.

    Usage
    To detect if you are equipping a piece of armor you can do
    Code (Java):
    if(e.getNewArmorPiece() != null && e.getNewArmorPiece().getType() != Material.AIR)
    To check if you are unequipping a piece of armor you can do a few changes to the above code.
    Code (Java):
    if(e.getOldArmorPiece() != null && e.getOldArmorPiece().getType() != Material.AIR)
    ItemStacks in the inventory can be either null or AIR so you have to check for both when checking if its null.

    You can also check what method the player did to equip the armor by doing
    Code (Java):
    event.getMethod()
    The six possible results are:
    • Shift Click: Pressing shift + left or right click
    • DRAG: Holding shift and dragging the item over the inventory slots then releasing left click.
    • PICK_DROP: Picking up the item and dropping it into the armor slot or inventory
    • Hotbar: Right clicking a piece of armor from the 9 hotbar slots.
    • Hotbar Swap: When you press 1-9 while hovering over an armor slot to equip/unequip the armor piece to/from that slot
    • Dispenser: Being in range of a dispenser when it shoots a piece of armor out.
    • Broke: When an armor piece breaks(If cancelled durability gets set to 0 which means one hit till it breaks again)
    • Death: When a player dies.


    This is also untested on Cauldron, I don't plan to add support and have no plans to make this for Sponge.

Recent Updates

  1. InventoryDragEvent and some other things.
  2. 1.6.3
  3. Bug fixes

Recent Reviews

  1. Mylogo
    Mylogo
    5/5,
    Version: 1.6.5
    Thanks for this! Why isn't this implemented in regular Bukkit/Spigot?^^
    Looks pretty good so far. I only encountered two issues:

    1) In the source, there's nothing about Dispensers even though you created the enum constant (the newArmorPiece was null in that case, even though it was a chestplate).
    2) When trying to insert an armor piece into your creative inventory armor slot (and you cancel the event in your listener), the armor piece disappears completely.

    I know that you usually don't insert improvements into the review section, but I thought it'd be fine in the form of a 5-star review ^.^
  2. Zao_hon
    Zao_hon
    5/5,
    Version: 1.6.5
    Thanks for your awesome plugins !
    But it doesnt support 1.13 now , if you have notime to do i could help you update this to 1.13 ! Because i love this plugin so much !
    1. Borlea
      Author's Response
      I've added a release for 1.7.1 which has a modified check that should fix any issues with 1.13. Since testing for 1.7 is still limited on my side it's not available on spigot.
  3. automatizer
    automatizer
    5/5,
    Version: 1.6.5
    Works really well, but it would be easier to use if there were two events: ArmorEquipEvent and ArmorUnequipEvent.
  4. OhhhZenix
    OhhhZenix
    5/5,
    Version: 1.6.5
    This lib is such a useful lib helps me out a lot in making my plugins. And keep it up my guy.
  5. Dot2Dot
    Dot2Dot
    5/5,
    Version: 1.6.5
    I would just like to say a very BIG thank you for developing such a user-friendly plugin and I am so greatful that such an excellent plugin is all for the cost of NONE I'm so proud that you are a plugin developer you should definitely make more plugins in the future, keep up the amazing work and this is to credit you for all your hard work on such a complex yet easy to learn plugin for custom enchantments, and I can so by far this is the BEST enchantment plugin that I have ever (in my 19 years of living) witnessed, I would recommend this plugin to all server developers who would like a custom RPG style factions server (I'm making an RPG Factions server speaking of which ^^) I wish you great luck for your future projects! If I could I'd rate 11/10 stars!
  6. Maxecito
    Maxecito
    5/5,
    Version: 1.6.3
    Works fine for me using a 1.9.2 spigot build! While there are some bugs those can't really be fixed since they originate from Minecraft sourcecode (such as triggering the equipment-event twice by clicking a lot)
  7. Dartanman
    Dartanman
    1/5,
    Version: 1.6.3
    I don't know what's wrong, but it doesn't work anymore. Borlea, PLEASE update this, yes, it loads as a plugin, but when we call it in our own plugins, it doesn't work. PLEASE fix it. Spigot 1.8.8
  8. bmac20
    bmac20
    1/5,
    Version: 1.6.2
    This plugin does not work anymore. I don't know if it is just outdated or what but when I tried contacting the dev, she answered, and when it seemed she did not know how to fix it, she did not even bother replying or trying to help me.

    I do not recommend this plugin unless you want something that does not work lol.
  9. KingPsychopath
    KingPsychopath
    5/5,
    Version: 1.6
    Beautifully written; and works like a charm.
    Author is also attentive and fixes bugs quickly.
    I recommend.
  10. Homer04
    Homer04
    5/5,
    Version: 1.5
    Amazing, beautiful written and definitely something thes missing in the Spigot API. Too bad someone broke it to use it.