armorstand changed from EntityHitEvent to EntityDeathEvent, SHOULD cause less fake errors

This commit is contained in:
urtypicalblahajlunatic
2026-06-27 14:29:49 +02:00
parent c89d885fd8
commit 4e65e1bcb2

View File

@@ -272,9 +272,10 @@ public class GriefAlert extends JavaPlugin implements Listener {
// Armor Stand break alerts
@EventHandler(ignoreCancelled = true)
public void onArmorStandBreak(EntityDamageByEntityEvent event) {
public void onArmorStandBreak(EntityDeathEvent event) {
if (!(event.getEntity() instanceof ArmorStand armorStand)) return;
if (!(event.getDamager() instanceof Player player)) return;
Player player = armorStand.getKiller();
if(player == null) return;
int x = armorStand.getLocation().getBlockX();
int y = armorStand.getLocation().getBlockY();
int z = armorStand.getLocation().getBlockZ();