EntityLeashableComponent Class
Caution
This class is still in pre-release. Its signature may change or it may be removed in future releases.
Extends
Allows the entity to be leashed. Defines the conditions and events for when an entity is leashed.
Properties
softDistance
read-only softDistance: number;
Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it.
Type: number
Warning
This property can throw errors when used.
Methods
leash
leash(leashHolder: Entity): void
Parameters
- leashHolder: Entity
Important
This function can't be called in read-only mode.
Warning
This function can throw errors.
unleash
unleash(): void
Unleashes this entity if it is leashed to another entity.
Important
This function can't be called in read-only mode.
Warning
This function can throw errors.
Constants
componentId
static read-only componentId = "minecraft:leashable";
Type: string
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for