Class: EntityRideableComponent
entity componentBeta
当添加时,此组件添加了实体可以被另一个实体骑乘的能力。
When added, this component adds the capability that an entity can be ridden by another entity.
Example
minibiomes.ts
Extends
Properties
controllingSeat
readonlycontrollingSeat:number
Beta
Remarks
可用于控制此实体的座位(从零开始索引)。
Zero-based index of the seat that can used to control this entity.
Throws
This property can throw when used.
crouchingSkipInteract
readonlycrouchingSkipInteract:boolean
Beta
Remarks
确定当实体蹲下时是否不支持交互。
Determines whether interactions are not supported if the entity is crouching.
Throws
This property can throw when used.
entity
readonlyentity:Entity
Beta
Remarks
拥有此组件的实体。如果实体已被移除,则实体将为 undefined。
The entity that owns this component. The entity will be undefined if it has been removed.
Throws
This property can throw when used.
Inherited from
interactText
readonlyinteractText:string
Beta
Remarks
当玩家看着要骑乘此实体时应该显示的一组文本(通常用于触摸屏控制)。
Set of text that should be displayed when a player is looking to ride on this entity (commonly with touch-screen controls).
Throws
This property can throw when used.
isValid
readonlyisValid:boolean
Beta
Remarks
返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。
Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.
Inherited from
passengerMaxWidth
readonlypassengerMaxWidth:number
Beta
Remarks
可成为乘客的生物的最大宽度。
The max width a mob can be to be a passenger.
Throws
This property can throw when used.
pullInEntities
readonlypullInEntities:boolean
Beta
Remarks
如果为 true,此实体将把具有正确 family_types 的实体拉入任何可用座位。
If true, this entity will pull in entities that are in the correct family_types into any available seat.
Throws
This property can throw when used.
riderCanInteract
readonlyriderCanInteract:boolean
Beta
Remarks
如果为 true,骑乘者看着此实体时可以被拾取。
If true, this entity will be picked when looked at by the rider.
Throws
This property can throw when used.
seatCount
readonlyseatCount:number
Beta
Remarks
为此实体定义的骑乘者座位数量。
Number of seats for riders defined for this entity.
Throws
This property can throw when used.
typeId
readonlytypeId:string
Beta
Remarks
组件的标识符。
Identifier of the component.
Inherited from
componentId
readonlystaticcomponentId:"minecraft:rideable"='minecraft:rideable'
Beta
Methods
addRider()
addRider(
rider):boolean
World Mutation Beta
Parameters
rider
将成为此实体骑乘者的实体。
Entity that will become the rider of this entity.
Returns
boolean
如果骑乘者实体成功添加,则返回 true。
True if the rider entity was successfully added.
Remarks
向此实体添加一个骑乘者实体。
Adds an entity to this entity as a rider.
Throws
This function can throw errors.
Example
minibiomes.ts
ejectRider()
ejectRider(
rider):void
World Mutation Beta
Parameters
rider
应从此实体弹射的实体。
Entity that should be ejected from this entity.
Returns
void
Remarks
弹射此实体的指定骑乘者。
Ejects the specified rider of this entity.
Throws
This function can throw errors.
ejectRiders()
ejectRiders():
void
World Mutation Beta
Returns
void
Remarks
弹射此实体的所有骑乘者。
Ejects all riders of this entity.
Throws
This function can throw errors.
getFamilyTypes()
getFamilyTypes():
string[]
Beta
Returns
string[]
Remarks
此实体支持的作为骑乘者的实体类型字符串列表。
A string-list of entity types that this entity can support as riders.
Throws
This function can throw errors.
getRiders()
getRiders():
Entity[]
Beta
Returns
Entity[]
Remarks
获取当前骑乘此实体的所有实体列表。
Gets a list of the all the entities currently riding this entity.
Throws
This function can throw errors.
getSeats()
getSeats():
Seat[]
Beta
Returns
Seat[]
Remarks
获取骑乘此实体的每个位置的位置和骑乘者数量列表。
Gets a list of positions and number of riders for each position for entities riding this entity.
Throws
This function can throw errors.
