diff --git a/src/main/java/org/infernalstudios/miningmaster/mixin/MixinAbstractArrow.java b/src/main/java/org/infernalstudios/miningmaster/mixin/MixinAbstractArrow.java index 0a68da6..4a3bf6e 100644 --- a/src/main/java/org/infernalstudios/miningmaster/mixin/MixinAbstractArrow.java +++ b/src/main/java/org/infernalstudios/miningmaster/mixin/MixinAbstractArrow.java @@ -52,7 +52,7 @@ private void MM_setEnchantsOnCreation(EntityType entityType, LivingEntity shoote @Inject(method = "onHitEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/projectile/AbstractArrow;doPostHurtEffects(Lnet/minecraft/world/entity/LivingEntity;)V")) private void MM_dealArrowEnchants(EntityHitResult hitResult, CallbackInfo ci) { if (this.freezingLevel > 0) { - if (hitResult.getEntity() instanceof LivingEntity livingEntity) { + if (hitResult.getEntity() instanceof LivingEntity livingEntity && !livingEntity.level.isClientSide()) { livingEntity.setTicksFrozen(livingEntity.getTicksFrozen() + livingEntity.getTicksRequiredToFreeze() + 120 * this.freezingLevel); } } diff --git a/src/main/java/org/infernalstudios/miningmaster/mixin/MixinPlayer.java b/src/main/java/org/infernalstudios/miningmaster/mixin/MixinPlayer.java index 331898d..03da2e1 100644 --- a/src/main/java/org/infernalstudios/miningmaster/mixin/MixinPlayer.java +++ b/src/main/java/org/infernalstudios/miningmaster/mixin/MixinPlayer.java @@ -55,7 +55,7 @@ private void MM_calculateEnchantEffects(Entity targetEntity, CallbackInfo ci, fl } private void applyFreezingEffects(Entity targetEntity, int level) { - if (targetEntity instanceof LivingEntity livingTarget) { + if (targetEntity instanceof LivingEntity livingTarget && !livingTarget.level.isClientSide()) { livingTarget.setTicksFrozen(livingTarget.getTicksFrozen() + livingTarget.getTicksRequiredToFreeze() + 120 * level); } }