Listener that records when a item gets damaged.

Discussion in 'Plugin Development' started by NanoSkill, Aug 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    NanoSkill

    So I currently wondering how you could set a listener in your plugin to record when a item such as a Diamond sword is damaged to a %.

    Thank you in advanced.
     
  2. Offline

    Xeiotos

    NanoSkill

    I would use a PlayerInteractEvent, and check for the item in the player's hand, getting the ItemStack. Then use getDurability(), and check item-specific what percentage of the total durability this is.
     
Thread Status:
Not open for further replies.

Share This Page