Skip to content

Instantly share code, notes, and snippets.

@heinrichquirit
Created September 8, 2013 09:21
Show Gist options
  • Save heinrichquirit/6483226 to your computer and use it in GitHub Desktop.
Save heinrichquirit/6483226 to your computer and use it in GitHub Desktop.
Check if entity is baby
@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