EntityLeashableComponent Class

Caution

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

Extends

Allows this entity to be leashed and defines the conditions and events for this entity when 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

Leashes this entity to another entity.

Parameters

  • leashHolder: Entity

    The entity to leash this entity to.

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