Class in @minecraft/server
Extends EntityComponent
What an entity, a player as well, rides.
import { EntityRidingComponent } from '@minecraft/server';Example
Section titled “Example”import { world, type EntityRidingComponent } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const component: EntityRidingComponent | undefined = player.getComponent('minecraft:riding'); if (component) { console.log(player.name, component.entityRidingOn.typeId); }}import { world } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const component = player.getComponent('minecraft:riding'); if (component) { console.log(player.name, component.entityRidingOn.typeId); }}Properties
Section titled “Properties”componentId
Section titled “componentId”static read-only
static readonly componentId: "minecraft:riding";typeId
Section titled “typeId”read-only
readonly typeId: "minecraft:riding";entity
Section titled “entity”read-only
readonly entity: Entity;Types
isValid
Section titled “isValid”read-only
readonly isValid: boolean;False once it’s off.
entityRidingOn
Section titled “entityRidingOn”read-only
readonly entityRidingOn: Entity;Types
Used by
Section titled “Used by”EntityComponentTypeMap.minecraft:riding, EntityComponentTypeMap.riding