spigot entity kill event code example
Example: spigot kill entity
@EventHandler
public void onEntitySpawn(EntitySpawnEvent event) {
if (event.getEntityType() == EntityType.CREEPER) {
if (event.getEntity() instanceof Damageable) {
Damageable creeper = (Damageable) event.getEntity();
creeper.damage(1000);
}
}
}