Custom Mob Spawners
Basically you look at a block, then type /cm spawn (custom spawner name) (mob type) (amount per spawn) (cooldown between spawns *seconds) (range in which the mob with spawn *blocks)
example: /cm spawn Battle1 Giant 1 15 25
*would be nice to choose any mob at all, including mobs from other mods.
Assuming you have correctly registered your custom entity with the EntityRegistry, you can spawn it via a spawner. The ID is your modID (from your @Mod annotation) + “.” + the entity string name passed to the EntityRegistry. For example, if I registered this entity and had the modID “MoreGolems”:
EntityRegistry.registerModEntity(EntityClayGolem.class, “EntClayGolem”, 0, this, 350, 5, false);
I can spawn it in a spawner by doing this:
So it’s probably in the form of “MoreGolems.EntClayGolem”
Edit: I’ve also tried copying NBT using ctrl+middle click, in 1.8.9 at least it doesn’t work on monster spawners
Here’s a test build to play around with. Base command is /spawner or /cs. One change from your request is instead of looking at where you want the spawner to be, simply stand in the location. This may change in the future, It was just an easier method for now.
Oh wow thanks! I’m assuming once you type /spawner it will list other commands? Also im not sure this is an issue atm but /cs is command script for world edit. I will play around with this tonight, thanks! I hope it allows for mod mobs Great Job on project worlds, its a game changer when you dont have multiverse, now we basically do!
Yes base command will list all available commands player has permission for. By the way base permission node is customspawners.cmd.spawner. I can chance the alias if it’s a problem. All mobs including from mods are registered with Sponge on start up therefore they should all work. I haven’t tested personally but I’m confident it’ll work. I’ve used a similar method in my BloodMoney plugin, which also supports Mobs from mods.
I’ve also already made some updates since my original post, Most notable is commands that allow to enable and disable spawners. I’ll post an official thread soon