Solved Help With

Discussion in 'Spigot Plugin Development' started by Dartanman, Jun 1, 2016.

  1. Hey guys! I have no idea what's wrong, but I'm working on a plugin, and this one part won't work! Basically, if a player moves with leggings that have a certain lore, they get a certain potion effect. This works with AND, but for some reason, not (Haven't made boots yet). Yes, all three of them are registered in the Main class. Please help me find out what's wrong!

    *Hidden source code since I do not want it public*

    Thanks for helping!
    #1 Dartanman, Jun 1, 2016
    Last edited: Jun 1, 2016
  2. Using PlayerMoveEvent is always a bad idea, unless there is no other way. Your best option is to listen for when they equip the item, and when they unequip it, then add the effect for an extremely long time rather than constantly re-applying it.
  3. Assuming that I don't want to change it?
  4. And if I change it, what's the event for armor equipping?
  5. There is no event for this specifically, you might have to use inventory click events to determine if they're equipping an item.
  6. You can use this instead of making your own armor equip event.
  7. Lel I figured it out. I type Chestplate where I should've typed Leggings. XD
  8. Regardless, this is very inefficient code and will lag a lot.
    • Agree Agree x 1