How to spawn mobs randomly using Minecraft commands?
Olivia Norman
Published Jul 11, 2026
I've downloaded a mod that lets me add the allay, copper golem and glare to Minecraft. They can be spawned using spawn eggs and commands. But they cannot spawn randomly naturally. I want these mobs to spawn randomly at different places only on random intervals.
I've not yet tried anything as I'm not good with commands. The mod is a forge mod with the Minecraft version being 1.16.5. I want the mobs to spawn randomly using commands or command blocks.
1 Answer
You can setup a command block to spawn them in specific locations, assuming you have the mobs ID (for example Minecraft:cow). But having them spawn randomly using the current datapack is not possible.
Now if you want to use command blocks, you could, theoretically spawn them at random places in loaded chunks, but I'm no expert at command blocks. You can spawn them in specific locations using /summon (mob id) (X-Y-Z) Replace the "(mob id)' and the "(X-Y-Z)" with the mob id and the coordinates you want to spawn the mob in. Your current coordinates can be seen using f3.
Now for the random intervals. You could use a chicken randomizer. to build this have a cage for a chicken, preferably 1x2. Have a pressure plate on one of the blocks and a chicken on the other. This pressure plate should power the command block that summons your mob. Note that this randomizer should be build at the spawn chunks, to find these die after breaking your bed, the chunks you spawn in should be the spawn chunks.
I hope this helps.
1