Class in @minecraft/server
Extends EntityComponent
Who may ride an entity, and who does: a minecart’s one seat. Players get on by using it, mobs it runs into are pulled in, and an activator rail with power throws them out.
import { EntityRideableComponent } from '@minecraft/server';Example
Section titled “Example”import { world, type EntityRideableComponent } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const component: EntityRideableComponent | undefined = player.getComponent('minecraft:rideable'); if (component) { console.log(player.name, component.controllingSeat); }}import { world } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const component = player.getComponent('minecraft:rideable'); if (component) { console.log(player.name, component.controllingSeat); }}Properties
Section titled “Properties”componentId
Section titled “componentId”static read-only
static readonly componentId: "minecraft:rideable";typeId
Section titled “typeId”read-only
readonly typeId: "minecraft:rideable";entity
Section titled “entity”read-only
readonly entity: Entity;isValid
Section titled “isValid”read-only
readonly isValid: boolean;controllingSeat
Section titled “controllingSeat”read-only
readonly controllingSeat: number;The seat of whoever steers it.
crouchingSkipInteract
Section titled “crouchingSkipInteract”read-only
readonly crouchingSkipInteract: boolean;A sneaking player doesn’t get on.
interactText
Section titled “interactText”read-only
readonly interactText: string;passengerMaxWidth
Section titled “passengerMaxWidth”read-only
readonly passengerMaxWidth: number;0 for no limit; otherwise a rider must be narrower.
pullInEntities
Section titled “pullInEntities”read-only
readonly pullInEntities: boolean;It takes on board the mobs it runs into.
riderCanInteract
Section titled “riderCanInteract”read-only
readonly riderCanInteract: boolean;seatCount
Section titled “seatCount”read-only
readonly seatCount: number;Methods
Section titled “Methods”addRider
Section titled “addRider”addRider(rider: Entity): boolean;Seats a player or a mob. False if it’s full, or the rider is on something already.
riderEntity
booleanejectRider
Section titled “ejectRider”ejectRider(rider: Entity): void;Lets a rider off beside it, where BDS lands riders.
riderEntity
ejectRiders
Section titled “ejectRiders”ejectRiders(): void;Lets everyone off, the last rider first.
getFamilyTypes
Section titled “getFamilyTypes”getFamilyTypes(): string[];The families that may ride; empty for any.
string[]getRiders
Section titled “getRiders”getRiders(): Entity[];Entity[]getSeats
Section titled “getSeats”getSeats(): Seat[];Seat[]Used by
Section titled “Used by”EntityComponentTypeMap.minecraft:rideable, EntityComponentTypeMap.rideable