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

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:

TagWhat it does
NoAI:1bThe mob stands still and does not attack. Good for shopkeepers and displays.
PersistenceRequired:1bThe mob never despawns when players walk away.
Invulnerable:1bNormal damage cannot hurt it (/kill still works).
Silent:1bNo sounds.
Tags:["boss"]Adds a tag you can select later with @e[tag=boss].
IsBaby:1bBaby zombie or piglin. Animals use Age:-24000 instead.

What you can add to a summoned mob

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}

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].

Related tools