Basic syntax
/summon <entity> [<x> <y> <z> [<nbt>]]
Arguments in <…> are required, and arguments in […] are optional. Supply coordinates before any NBT.
| Argument | Meaning |
|---|---|
entity | The ID of the entity to spawn. For example, minecraft:pig is a pig. |
x y z | With no coordinates, the entity spawns at the execution position. ~ ~ ~2 offsets the position by two blocks along the Z axis. |
nbt | An SNBT compound {…} sets the name, behavior, or other properties. Available tags depend on the entity and version. |
Examples
Spawn a pig two blocks away along Z
/summon minecraft:pig ~ ~ ~2
Open these settings in the generator →
Spawn a baby zombie with its AI disabled
/summon minecraft:zombie ~ ~ ~2 {IsBaby:1b,NoAI:1b}
Open these settings in the generator →
Create a villager trade
List trades in Offers.Recipes. Each trade has a buy payment, a sell result, and an optional second payment in buyB.
Select Villager in the generator to add or remove trades, search for items, and set their counts or the maximum number of uses.
Spawn a librarian who sells a bookshelf for three emeralds
/summon minecraft:villager ~ ~ ~2 {VillagerData:{type:"minecraft:plains",profession:"minecraft:librarian",level:1},Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:3},sell:{id:"minecraft:bookshelf"},maxUses:12}]}}
Open these settings in the generator →
Version differences for names and equipment
In Java 1.21.5 and later, write the text component directly, as in CustomName:{text:"Scout"}. In 1.21.4 and earlier it is a JSON string.
The same update consolidated HandItems and ArmorItems into equipment. The generator uses the format for the selected release.