Created
September 8, 2013 09:21
-
-
Save heinrichquirit/6483226 to your computer and use it in GitHub Desktop.
Check if entity is baby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void onEntityDeath(EntityDeathEvent event) { | |
if (event.getEntity() instanceof Ageable) { | |
Ageable entity = (Ageable)event.getEntity(); | |
if (!entity.isAdult()) { | |
Bukkit.broadcastMessage("A baby died."); | |
} else { | |
Bukkit.broadcastMessage("An adult died."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment