0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-31 12:01:22 +00:00
Paper/paper-server/patches/sources/net/minecraft/world/effect/MobEffectInstance.java.patch
2025-01-12 17:50:22 +01:00

11 lines
795 B
Diff

--- a/net/minecraft/world/effect/MobEffectInstance.java
+++ b/net/minecraft/world/effect/MobEffectInstance.java
@@ -216,6 +_,7 @@
int i = this.isInfiniteDuration() ? entity.tickCount : this.duration;
if (entity.level() instanceof ServerLevel serverLevel
&& this.effect.value().shouldApplyEffectTickThisTick(i, this.amplifier)
+ && new io.papermc.paper.event.entity.EntityEffectTickEvent(entity.getBukkitLivingEntity(), org.bukkit.craftbukkit.potion.CraftPotionEffectType.minecraftHolderToBukkit(this.effect), this.amplifier).callEvent() // Paper - Add EntityEffectTickEvent
&& !this.effect.value().applyEffectTick(serverLevel, entity, this.amplifier)) {
entity.removeEffect(this.effect);
}