Updated:
To summon a mob, begin with the entity ID and position. A working /summon command should be checked before adding a name or equipment.
Basic summon examples
/summon minecraft:zombie ~ ~ ~/summon minecraft:villager ~ ~ ~/summon minecraft:item ~ ~1 ~ {Item:{id:"minecraft:diamond",count:1}}for dropped item tests (Java 1.20.5 and later; an item entity needs anItemvalue or it disappears).
Useful options
After the basic entity works, add one option at a time so you can find the exact cause if the command breaks. These tags work in Java Edition:
| Tag | What it does |
|---|---|
NoAI:1b | The mob stands still and does not attack. Good for shopkeepers and displays. |
PersistenceRequired:1b | The mob never despawns when players walk away. |
Invulnerable:1b | Normal damage cannot hurt it (/kill still works). |
Silent:1b | No sounds. |
Tags:["boss"] | Adds a tag you can select later with @e[tag=boss]. |
IsBaby:1b | Baby zombie or piglin. Animals use Age:-24000 instead. |
What you can add to a summoned mob
- Adventure map enemies with custom names.
- Shop villagers with trades.
- Boss mobs for minigames.
- Testing areas for datapacks and command blocks.
Spawn a test mob
/summon minecraft:pig ~ ~1 ~In modern Java Edition this summons a pig one block above the execution position. Use an open area and make sure commands are enabled. Tilde coordinates are relative; from a command block they use the block's position rather than the player's position.
When nothing seems to appear
Check the surrounding space, entity ID and whether the target world permits the entity to spawn. Some mobs can immediately move, disappear or be affected by game rules. Start with a common passive mob rather than an advanced custom entity to separate syntax problems from game behavior.
Adding equipment or custom tags
Advanced entity properties depend on the Java version and can be different or unavailable in Bedrock. Create the basic summon first, then add a name or equipment in the summon generator. If the command fails after that, the last added option is the first thing to inspect.
A named boss with gear (Java 1.21.5+)
/summon minecraft:zombie ~ ~ ~ {CustomName:"Gate Keeper",CustomNameVisible:1b,PersistenceRequired:1b,Tags:["boss"],equipment:{mainhand:{id:"minecraft:diamond_sword",count:1},head:{id:"minecraft:netherite_helmet",count:1}},drop_chances:{mainhand:0.0f,head:0.0f},attributes:[{id:"minecraft:max_health",base:100}],Health:100f}
- CustomName: from 1.21.5 a plain string works. In 1.20.5–1.21.4 write it as JSON text inside quotes:
CustomName:'"Gate Keeper"'. - equipment and drop_chances replaced
HandItems,ArmorItemsand their drop chance lists in 1.21.5. A drop chance of 0 stops the gear from dropping. - max_health raises the limit, and Health fills it. Without Health the zombie spawns with 20. Before 1.21.2 the attribute ID is
minecraft:generic.max_health.
Bedrock Edition
/summon zombie "Gate Keeper" ~ ~ ~
/summon cow ~ ~ ~ 0 0 minecraft:entity_born
Bedrock has no data tags. You can give a name tag directly, and a spawn event changes how the mob starts, for example minecraft:entity_born makes a baby cow. For gear, use /replaceitem entity after summoning.
Spawning many mobs safely
A repeating command block runs 20 times a second, so a summon inside it creates 20 mobs every second and can freeze a world. Use an impulse block with a button, or limit it with a check:
/execute unless entity @e[tag=boss] run summon minecraft:zombie ~ ~1 ~ {Tags:["boss"]}
This only summons a new boss when none exists. If too many mobs already appeared, remove them with /kill @e[type=minecraft:zombie,distance=..50].