Check if item is damageable?

Discussion in 'Plugin Development' started by Tim_M, Nov 19, 2021.

  1. Offline


    I need to check if item can take damage e.g. Sword, Axe, Fishing Rod etc.
    Or if it can't e.g. stone, enderpearl etc.

    I have tried the following:
    item.getItemMeta() instanceof org.bukkit.inventory.meta.Damageable
    but it's always true no matter what item I check, any help?
  2. Offline


    I havn't looked into that but couldn't you use getDurability()? What does that return for items that don't have any? Just my thoughts, good luck ;)

Share This Page