Updated:
Ride the nearest pig
| Version | Command |
|---|---|
| Java 1.19.4 and later | /ride @s mount @e[type=minecraft:pig,limit=1,sort=nearest] |
| Bedrock Edition | /ride @s start_riding @e[type=pig,c=1] |
The rider comes first and the vehicle second. Without a saddle you can sit on a pig or horse but not steer it.
Dismount
| Version | Command |
|---|---|
| Java | /ride @s dismount |
| Bedrock | /ride @s stop_riding |
On Bedrock, /ride @e[type=boat,c=1] evict_riders removes everyone from a vehicle.
Make a jockey
/ride @e[type=minecraft:skeleton,limit=1,sort=nearest] mount @e[type=minecraft:spider,limit=1,sort=nearest]
Both the rider and the vehicle must be a single entity, so use limit=1. To spawn them already stacked, use Passengers:
/summon minecraft:spider ~ ~ ~ {Passengers:[{id:"minecraft:skeleton"}]}
Bedrock extras
/ride @e[type=horse,c=1] summon_rider zombiespawns a zombie riding the horse./ride @s summon_ride horsespawns a horse under you.- Add
teleport_rideafterstart_ridingto move the vehicle to the rider instead of the rider to the vehicle.
Stack more than two mobs
Passengers can hold their own Passengers, so one /summon builds a whole tower. This spawns three slimes stacked on top of each other:
/summon minecraft:slime ~ ~ ~ {Passengers:[{id:"minecraft:slime",Passengers:[{id:"minecraft:slime"}]}]}
A chicken jockey works the same way, with a baby zombie as the rider:
/summon minecraft:chicken ~ ~ ~ {Passengers:[{id:"minecraft:zombie",IsBaby:1b}]}
Put a player in a minecart or boat
/ride @p mount @e[type=minecraft:minecart,limit=1,sort=nearest]
For boats, the entity ID depends on the version. Java 1.21.2 and later use one ID per wood type, such as minecraft:oak_boat or minecraft:spruce_chest_boat. Older versions use minecraft:boat with a Type tag.
Steering after you mount
- Pig: needs a saddle, then hold a carrot on a stick to steer.
- Strider: needs a saddle and a warped fungus on a stick.
- Horse, donkey, mule, camel: must be tamed and saddled. Summon a tamed horse with
/summon minecraft:horse ~ ~ ~ {Tame:1b}and put a saddle in its inventory. - Other mobs: you can sit on them with /ride, but they keep walking on their own.
Run commands on the vehicle or the riders
Java 1.19.4 also added execute on, which switches to the entity a player is riding, or to the entities riding something.
/execute as @a on vehicle run effect give @s minecraft:speed 10 1
This gives Speed to every mount that currently carries a player. Players who are not riding anything are skipped, so the same line also works as a "who is riding" test. Use on passengers to go the other way, for example to dismount everyone from the nearest horse:
/execute as @e[type=minecraft:horse,limit=1,sort=nearest] on passengers run ride @s dismount
Keeping a player seated
Players can always get off by pressing sneak. If a map needs them to stay seated, run the mount command again from a repeating command block, and give the vehicle NoAI:1b so it does not wander. Expect a short flicker each time the player is put back.
Common problems
- Unknown command (Java): /ride needs 1.19.4 or later. Use Passengers on older versions.
- Too many targets (Java): add
limit=1,sort=nearest. - Cannot ride a player (Java): players cannot be vehicles.
- Already riding: dismount first.
- Bedrock refuses the vehicle: only rideable entities such as horses, pigs, minecarts and boats work.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.