Skip to content

Commit

Permalink
Fixed event.setCancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
needkg committed Aug 8, 2024
1 parent d0518d4 commit 56609e2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
Player damager = (Player) event.getDamager();
Player damaged = (Player) event.getEntity();

event.setCancelled(checkHooks(damaged, damager, damaged.getWorld().getName()));
if (checkHooks(damaged, damager, damaged.getWorld().getName())) {
event.setCancelled(true);
}
}

@EventHandler(priority = EventPriority.HIGH)
Expand Down

0 comments on commit 56609e2

Please sign in to comment.