Posted December 7, 20213 yr I am creating a projectile that can bypass a certain amount of the target's armor by taking the effective "armor value", reducing it by a coefficient, and then applying the damage. I know getArmorInventoryList() returns armor the entity is wearing, but can't access the protection values of each individual piece as it only returns an ItemStack. Thanks in advance for any help.
December 7, 20213 yr you can use ItemStack#getItem to get the Item, then check if the Item an instance of ArmorItem. then use ArmorItem#getDefense to get the Armor value
December 7, 20213 yr Author Your suggestions worked, thanks again. Edited December 7, 20213 yr by CrackedScreen
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.