NoEndermanInBrightArea
作者:rebot | 分类:模组
Minecraft 版本: 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.21.8
平台: bukkit paper spigot
This plugin stops enderman from spawning in bright area by just cancel the spawn event if the block light level is not zero.
@EventHandler
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.getEntityType() != EntityType.ENDERMAN) return;
if (event.getLocation().getWorld().getBlockAt(event.getLocation()).getLightFromBlocks() == 0) return;
event.setCancelled(true);
}请登录后举报
暂无评论,抢个沙发吧~