Jump to content

Recommended Posts

Posted (edited)

Is there a method in 1.18.X to check when an armor item takes damage within it's own class? In 1.16.5 I remember seeing damageArmor() override or something similar accessible by classes extended from ItemArmor which served this purpose.
I am also looking for a way to get the durability loss caused by a damage source. If this is possible (from either inside armor class or event), does it take the Unbreaking enchantment into account?

Thanks in advance.

Edited by CrackedScreen
Thread marked as solved.
Posted (edited)

DamageItem works fine, but doesn't account for durability loss cancelled by Unbreaking enchantments. Is this something I will need to handle myself, or are there other accessible fields I can use inside this method?

Edited by CrackedScreen
  • CrackedScreen changed the title to [1.18.X] [SOLVED] Checking when an armor item takes damage

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.