Skip to content

Commit

Permalink
only damage bunny ears when jump boost is caused by the item
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed May 14, 2024
1 parent 2655349 commit ddb554b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public void onUnequippedHatItem(LivingEntity entity, ItemStack oldStack) {

@Override
public void onLivingJumpEvent(LivingEntity jumpingEntity, ItemStack headSlotItemStack) {
this.damageHatItemByOne(headSlotItemStack, jumpingEntity);
int amplifier = Services.PLATFORM.getEnchantmentLevel(headSlotItemStack, Enchantments.BLOCK_EFFICIENCY);
if (!this.isEffectCausedByOtherSource(jumpingEntity, MobEffects.JUMP, JUMP_BOOST_DURATION, amplifier)) {
this.damageHatItemByOne(headSlotItemStack, jumpingEntity);
}
}
}

0 comments on commit ddb554b

Please sign in to comment.