What is the code so when hostile mobs try to spawn it replaces all of them with zombies? I've tried this and it just spams errors: Code:java package me.zombie; import org.bukkit.entity.EntityType;import org.bukkit.entity.Monster;import org.bukkit.event.EventHandler;import org.bukkit.event.EventPriority;import org.bukkit.event.Listener;import org.bukkit.event.entity.CreatureSpawnEvent;import org.bukkit.plugin.PluginManager;import org.bukkit.plugin.java.JavaPlugin; public class zombie extends JavaPlugin implements Listener{ public void onEnable() {PluginManager pm = getServer().getPluginManager();pm.registerEvents(this, this); } public void onDisable() { }@EventHandler (priority = EventPriority.NORMAL)public void onCreatureSpawn(CreatureSpawnEvent e){ if (e.getEntity() instanceof Monster){e.getLocation().getWorld().spawnEntity(e.getLocation(), EntityType.ZOMBIE);e.getEntity().remove(); return;}}}
Code: @EventHandler(priority = EventPriority.HIGH) public void onCreatureSpawnEvent(CreatureSpawnEvent event){ World w2 = event.getEntity().getWorld(); w2.setMonsterSpawnLimit(350); EntityType type = event.getEntity().getType(); if(type == EntityType.CAVE_SPIDER || type == EntityType.ZOMBIE || type == EntityType.SKELETON || type == EntityType.SPIDER || type == EntityType.GIANT || type == EntityType.SILVERFISH){ Location loc = event.getEntity().getLocation(); event.getEntity().remove(); World w = loc.getWorld(); w.spawnEntity(loc, EntityType.CREEPER); } } } you can edit that for your own purpose ^^ this replaces all hostile mobs by creepers
Code: @EventHandler(priority = EventPriority.HIGH) public void onCreatureSpawnEvent(CreatureSpawnEvent event){ World w2 = event.getEntity().getWorld(); w2.setMonsterSpawnLimit(350); EntityType type = event.getEntity().getType(); if(type == EntityType.CAVE_SPIDER || type == EntityType.ZOMBIE || type == EntityType.SKELETON || type == EntityType.SPIDER || type == EntityType.GIANT || type == EntityType.SILVERFISH){ Location loc = event.getEntity().getLocation(); event.getEntity().remove(); World w = loc.getWorld(); w.spawnEntity(loc, EntityType.CREEPER); } } }