armorstand changed from EntityHitEvent to EntityDeathEvent, SHOULD cause less fake errors
This commit is contained in:
@@ -272,9 +272,10 @@ 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;
|
Player player = armorStand.getKiller();
|
||||||
|
if(player == null) 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();
|
||||||
|
|||||||
Reference in New Issue
Block a user