Allows entities to mount or dismount other entities.
Usage[]
In Java Edition, all types of entities (except marker and player) can ride and be ridden by other entities of any types. Marker and player cannot be ridden.
In Bedrock Edition, an entity cannot ride entities which are not normally rideable for it in vanilla game, which is mainly data driven, controlled by the minecraft:rideable
component in the entity files in behavior packs (see Riding#Valid riding combinations in vanilla for details; see also the official doc). In Bedrock Edition, this command can also be used to summon passengers and mounts.
Syntax[]
- Java Edition
ride <target> mount <vehicle>
- Makes
<target>
ride on<vehicle>
.
- Makes
ride <target> dismount
- Dismounts
target
from any vehicle it is riding.
- Dismounts
- Bedrock Edition
ride <riders: target> start_riding <ride: target> [teleportRules: TeleportRules] [howToFill: FillType]
- Tries to make
<riders: target>
ride on<ride: target>
.
- Tries to make
ride <riders: target> stop_riding
- Makes
<riders: target>
dismount.
- Makes
ride <rides: target> evict_riders
- Makes entities that are riding on
<rides: target>
dismount.
- Makes entities that are riding on
ride <rides: target> summon_rider <entityType: EntityType> [spawnEvent: string] [nameTag: string]
- Summons an entity at the position of each of
<rides: target>
that are rideable and not full, and then tries to make them ride on<rides: target>
.
- Summons an entity at the position of each of
ride <riders: target> summon_ride <entityType: EntityType> [rideRules: RideRules] [spawnEvent: string] [nameTag: string]
- Summons an entity at the position of each of
<riders: target>
, and then tries to make<riders: target>
ride on them.
- Summons an entity at the position of each of
Arguments[]
- Specifies the passenger.
- Must be a player name, a target selector or a UUID. And the target selector must be in single type.
- Specifies the mount.
- Must be a player name, a target selector or a UUID. And the target selector must be in single type.
BE: riders: target
: CommandSelector<Actor>
- Specifies the passengers.
- If in
start_riding
mode, should be only one entity ifteleportRules: TeleportRules
isteleport_ride
. - Must be a player name or a target selector.
BE: ride: target
: CommandSelector<Actor>
- Specifies an mount.
- Should be only one entity.
- Must be a player name or a target selector.
BE: rides: target
: CommandSelector<Actor>
- Specifies the mounts.
- Must be a player name or a target selector.
BE: teleportRules: TeleportRules
: enum
- Must be one of
teleport_ride
andteleport_rider
. - Specified which entities are teleported. If unspecified, defaults to
teleport_rider
.
- Must be one of
if_group_fits
anduntil_full
.- If
if_group_fits
, checks whether allriders: target
can ride onride: target
at the same time, and makes them ride only if true. - If
until_full
or unspecified, makes them ride up one by one until it's full.
- If
BE: entityType: EntityType
: enum
- Specifies the entities to be summoned.
- This argument type is not registered in game.
BE: spawnEvent: string
: basic_string
- Specifies the entity event for the to-be-summoned entities. Should be a spawn event (event name for entities in behavior pack).
- Must be a string. And it must be a single word that has no space or a quoted string.
BE: nameTag: string
: basic_string
- Specifies the name of the to-be-summoned entities.
- Must be a string. And it must be a single word that has no space or a quoted string.
BE: rideRules: RideRules
: enum
- Must be one of
no_ride_change
,reassign_rides
, andskip_riders
.- If
skip_riders
, summons entities only for<riders: target>
that are not riding on another entity. - If
no_ride_change
, summons entities only for<riders: target>
that are not riding on and not ridden by other entity(s). - If
reassign_rides
or unspecified, makes<riders: target>
dismount if they're riding, then summons entities for all of them.
- If
Result[]
Command | Trigger | Java Edition | Bedrock Edition |
---|---|---|---|
any | the arguments are not specified correctly | Unparseable | Unparseable |
<target> , or vehicle fails to resolve to an entity (named players must be online) | Failed | N/A | |
/ride ... mount ... | <target> is already riding on an entity | ||
vehicle is a player | |||
a mounting loop is detected (vehicle is riding <target> , or its passengers, or passengers of its passengers, etc.) | |||
<target> and vehicle are in different dimensions | |||
<vehicle> is a marker | |||
/ride ... dismount | <target> is not riding on an entity | ||
riders: target , rides: target , or ride: target fails to resolve to one or more entities (named players must be online) | N/A | Failed | |
/... start_riding ... | more than one entity is targeted by ride: target | ||
the entity targeted by ride: target is already full | |||
teleportRules: TeleportRules is teleport_ride and more than one entity is targeted by <riders: target> . | |||
howToFill: FillType is not specified or until_full and the ride: target is not rideable for all of <riders: target> | |||
howToFill: FillType is if_group_fits and too many entities is targeted by <riders: target> to ride up at the same time. | |||
howToFill: FillType is if_group_fits and the ride: target is not rideable for at least one of <riders: target> | |||
/... stop_riding | none of <riders: target> is riding on other entity. | ||
/... evict_riders | none of <rides: target> is ridden by other entities. | ||
/... summon_rider ... | all <rides: target> are already full or not rideable for the riders. | ||
trying to summon hostiles in peaceful difficulty. | |||
/... summon_ride ... | all summoned entities are not rideable for <riders: target> . | ||
trying to summon hostiles in peaceful difficulty. | |||
any | Otherwise | Successful |
Output[]
Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
---|---|---|---|---|---|
any | Java Edition | On fail | 0 | 0 | 0 |
On success | 1 | 1 | 1 | ||
any | Bedrock Edition | On fail | 0 | N/A | N/A |
/... start_riding ... | On success | the number of entities that get riding on the targeted ride | N/A | N/A | |
/... stop_riding ... | On success | the number of entities that get dismounted | N/A | N/A | |
/... evict_riders ... | On success | the number of entities that successfully evict their riders | N/A | N/A | |
/... summon_rider ... | On success | the number of summoned entities that successfully ride on their linked rides | N/A | N/A | |
/... summon_ride ... | On success | the number of summoned entities that are successfully ridden by their linked riders | N/A | N/A |
Example[]
In Java Edition, make the nearest player ride on an nearest arrow:
/ride @p mount @e[type=arrow,sort=nearest,limit=1]
In Bedrock Edition, summon an arrow at the position of each player who have "A" tag:
/ride @a[tag=A] summon_ride arrow
In Bedrock Edition, summon a charged creeper at the position of each player who have "A" tag:
/ride @a[tag=A] summon_ride creeper reassign_rides minecraft:become_charged
History[]
Java Edition | |||||
---|---|---|---|---|---|
1.19.4 | 23w03a | Added /ride . | |||
Bedrock Edition | |||||
1.16.100 | beta 1.16.100.52 | Added /ride . |