diff --git a/src/main/java/org/cyclops/evilcraft/enchantment/entityeffect/EnchantmentEntityEffectHealFromDamage.java b/src/main/java/org/cyclops/evilcraft/enchantment/entityeffect/EnchantmentEntityEffectHealFromDamage.java index 901b79c975..23395a818d 100644 --- a/src/main/java/org/cyclops/evilcraft/enchantment/entityeffect/EnchantmentEntityEffectHealFromDamage.java +++ b/src/main/java/org/cyclops/evilcraft/enchantment/entityeffect/EnchantmentEntityEffectHealFromDamage.java @@ -12,6 +12,7 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.entity.living.LivingDamageEvent; +import net.neoforged.neoforge.event.server.ServerStoppedEvent; import org.cyclops.evilcraft.Reference; /** @@ -36,6 +37,11 @@ public static void stealLife(LivingDamageEvent.Post event) { } } + @SubscribeEvent(priority = EventPriority.NORMAL) + public static void onServerStopped(ServerStoppedEvent event) { + lastDamageEvent = null; + } + @Override public void apply(ServerLevel level, int enchantmentLevel, EnchantedItemInUse enchantedItemInUse, Entity entity, Vec3 vec) { if (lastDamageEvent != null && lastDamageEvent.getSource().getEntity() == entity) {