Get all enchantments on items?

Discussion in 'Spigot Plugin Development' started by Snowmite, Jun 8, 2017.

Thread Status:
Not open for further replies.
  1. Is there a method that returns all enchantments as a list on items?
     
  2. Do you know Java basics? If not, I suggest doing a few basic tutorials before diving in here.

    The method returns a HashMap with the keys being the enchantments and the values being their level. So, you'd need to loop over the Map.Entry, or if you don't care about levels then the keySet will do. It all depends on what you're trying to do exactly.
     
Thread Status:
Not open for further replies.