Skip to content

Commit

Permalink
Slightly nerf Dolphin's Grace
Browse files Browse the repository at this point in the history
Fixes #50
  • Loading branch information
Dariensg committed Jun 29, 2023
1 parent 1ae5949 commit b53a70c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ public static void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
for (int i = 0; i < nbtList.size(); i++) {
CompoundTag idTag = nbtList.getCompound(i);
if (idTag.getString("id").equals(MMEnchantments.GRACE.getId().toString())) {
if (livingEntity.hasEffect(MobEffects.DOLPHINS_GRACE) && playerEntity != null && !playerEntity.isCreative() && rand.nextInt(100) == 0) {
stack.hurtAndBreak(1, livingEntity, (onBroken) -> {
onBroken.broadcastBreakEvent(EquipmentSlot.CHEST);
});
if (livingEntity.hasEffect(MobEffects.DOLPHINS_GRACE) && playerEntity != null && !playerEntity.isCreative() && rand.nextInt(80) == 0) {
stack.hurtAndBreak(1, livingEntity, (onBroken) -> onBroken.broadcastBreakEvent(EquipmentSlot.CHEST));
}
if (((LivingEntityAccess) livingEntity).getGraceRecharged()) {
livingEntity.addEffect(new MobEffectInstance(MobEffects.DOLPHINS_GRACE, 120 * idTag.getInt("lvl")));
livingEntity.addEffect(new MobEffectInstance(MobEffects.DOLPHINS_GRACE, 100 * idTag.getInt("lvl")));
((LivingEntityAccess) livingEntity).setGraceRecharged(false);
}
}
Expand Down

0 comments on commit b53a70c

Please sign in to comment.