📜  spigot 杀死实体 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:12.732000             🧑  作者: Mango

代码示例1
@EventHandler
    public void onEntitySpawn(EntitySpawnEvent event) {
        if (event.getEntityType() == EntityType.CREEPER) {
            if (event.getEntity() instanceof Damageable) {
                
                Damageable creeper = (Damageable) event.getEntity();
                creeper.damage(1000);
            }
        }
    }