EntityRideableComponent Class

Caution

This class is still in pre-release. Its signature may change or it may be removed in future releases.

Extends

When added, this component adds the capability that an entity can be ridden by another entity.

Properties

controllingSeat

read-only controllingSeat: number;

Zero-based index of the seat that can used to control this entity.

Type: number

Warning

This property can throw errors when used.

crouchingSkipInteract

read-only crouchingSkipInteract: boolean;

Determines whether interactions are not supported if the entity is crouching.

Type: boolean

Warning

This property can throw errors when used.

interactText

read-only interactText: string;

Set of text that should be displayed when a player is looking to ride on this entity (commonly with touch-screen controls).

Type: string

Warning

This property can throw errors when used.

passengerMaxWidth

read-only passengerMaxWidth: number;

The max width a mob can be to be a passenger.

Type: number

Warning

This property can throw errors when used.

pullInEntities

read-only pullInEntities: boolean;

If true, this entity will pull in entities that are in the correct family_types into any available seat.

Type: boolean

Warning

This property can throw errors when used.

riderCanInteract

read-only riderCanInteract: boolean;

If true, this entity will be picked when looked at by the rider.

Type: boolean

Warning

This property can throw errors when used.

seatCount

read-only seatCount: number;

Number of seats for riders defined for this entity.

Type: number

Warning

This property can throw errors when used.

Methods

addRider

addRider(rider: Entity): boolean

Adds an entity to this entity as a rider.

Parameters

  • rider: Entity

    Entity that will become the rider of this entity.

Returns boolean - True if the rider entity was successfully added.

Important

This function can't be called in read-only mode.

Warning

This function can throw errors.

ejectRider

ejectRider(rider: Entity): void

Ejects the specified rider of this entity.

Parameters

  • rider: Entity

    Entity that should be ejected from this entity.

Important

This function can't be called in read-only mode.

Warning

This function can throw errors.

ejectRiders

ejectRiders(): void

Ejects all riders of this entity.

Important

This function can't be called in read-only mode.

Warning

This function can throw errors.

getFamilyTypes

getFamilyTypes(): string[]

A string-list of entity types that this entity can support as riders.

Returns string[]

Warning

This function can throw errors.

getRiders

getRiders(): Entity[]

Gets a list of the all the entities currently riding this entity.

Returns Entity[]

Warning

This function can throw errors.

getSeats

getSeats(): Seat[]

Gets a list of positions and number of riders for each position for entities riding this entity.

Returns Seat[]

Warning

This function can throw errors.

Constants

componentId

static read-only componentId = "minecraft:rideable";

Type: string