changed Armorstand Logic #3

Merged
Kleedje30 merged 2 commits from armorstand-DeathLogic into main 2026-06-27 14:38:18 +00:00

View File

@@ -272,9 +272,9 @@ public class GriefAlert extends JavaPlugin implements Listener {
// Armor Stand break alerts // Armor Stand break alerts
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void onArmorStandBreak(EntityDamageByEntityEvent event) { public void onArmorStandBreak(EntityDeathEvent event) {
if (!(event.getEntity() instanceof ArmorStand armorStand)) return; if (!(event.getEntity() instanceof ArmorStand armorStand)) return;
if (!(event.getDamager() instanceof Player player)) return; if(!(event.getDamageSource().getCausingEntity() instanceof Player player)) return;
int x = armorStand.getLocation().getBlockX(); int x = armorStand.getLocation().getBlockX();
int y = armorStand.getLocation().getBlockY(); int y = armorStand.getLocation().getBlockY();
int z = armorStand.getLocation().getBlockZ(); int z = armorStand.getLocation().getBlockZ();
@@ -288,6 +288,7 @@ public class GriefAlert extends JavaPlugin implements Listener {
String message = ChatColor.GRAY + playerName + " broke an armor stand placed by " + target + " at " + x + " " + y + " " + z + getHumanWorldName(worldName); String message = ChatColor.GRAY + playerName + " broke an armor stand placed by " + target + " at " + x + " " + y + " " + z + getHumanWorldName(worldName);
alert(message, playerName, "[Map Link](" + MAP_LINK + "/?worldname=" + worldName + "&zoom=7&x=" + x + "&y=" + y + "&z=" + z + ")", target, x, y, z, worldName); alert(message, playerName, "[Map Link](" + MAP_LINK + "/?worldname=" + worldName + "&zoom=7&x=" + x + "&y=" + y + "&z=" + z + ")", target, x, y, z, worldName);
} }
} }
// Armor Stand item interaction alerts // Armor Stand item interaction alerts