Skip to content

Commit 98b5220

Browse files
authored
Listen to EntityPushedByEntityAttackEvent for knockback/push (#2193)
Listening to the push event instead of EntityKnockbackByEntity includes other sources of knockback/push in the internal DamageEntityEvent. Closes #2190.
1 parent 65792ec commit 98b5220

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.sk89q.worldguard.config.WorldConfiguration;
4848
import com.sk89q.worldguard.protection.flags.Flags;
4949
import io.papermc.lib.PaperLib;
50+
import io.papermc.paper.event.entity.EntityPushedByEntityAttackEvent;
5051
import io.papermc.paper.event.player.PlayerOpenSignEvent;
5152
import org.bukkit.Bukkit;
5253
import org.bukkit.Effect;
@@ -1332,8 +1333,8 @@ public void onSignOpen(PlayerOpenSignEvent event) {
13321333
}
13331334

13341335
@EventHandler(ignoreCancelled = true)
1335-
public void onEntityKnockbackByEntity(com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent event) {
1336-
handleKnockback(event, event.getHitBy());
1336+
public void onEntityKnockbackByEntity(EntityPushedByEntityAttackEvent event) {
1337+
handleKnockback(event, event.getPushedBy());
13371338
}
13381339
}
13391340

0 commit comments

Comments
 (0)