Add EntityEffectTickEvent (#11838)

This commit is contained in:
caramel
2025-01-13 01:50:22 +09:00
committed by GitHub
parent eb4db794eb
commit 76617ddf43
4 changed files with 99 additions and 1 deletions

View File

@@ -9,8 +9,11 @@
} else {
entity.hurtServer(level, entity.damageSources().magic(), 6 << amplifier);
}
@@ -30,7 +_,7 @@
@@ -28,9 +_,10 @@
public void applyInstantenousEffect(
ServerLevel level, @Nullable Entity source, @Nullable Entity indirectSource, LivingEntity entity, int amplifier, double health
) {
+ if (!new io.papermc.paper.event.entity.EntityEffectTickEvent(entity.getBukkitLivingEntity(), org.bukkit.craftbukkit.potion.CraftPotionEffectType.minecraftToBukkit(this), amplifier).callEvent()) { return; } // Paper - Add EntityEffectTickEvent
if (this.isHarm == entity.isInvertedHealAndHarm()) {
int i = (int)(health * (4 << amplifier) + 0.5);
- entity.heal(i);