Basalt's own: toLocation, the feet, may be moved.
Interface in @minecraft/server
Extends CancellableEvent
Basalt’s own: toLocation, the feet, may be moved.
import type { PlayerTeleportBeforeEvent } from '@minecraft/server';Subscribe to it with world.beforeEvents.playerTeleport.
Example
Section titled “Example”import { world, type PlayerTeleportBeforeEvent } from '@minecraft/server';
world.beforeEvents.playerTeleport.subscribe((event: PlayerTeleportBeforeEvent) => { console.log('playerTeleport', event.player.name);
// Uncomment to stop it from happening. // event.cancel = true;});import { world } from '@minecraft/server';
world.beforeEvents.playerTeleport.subscribe((event) => { console.log('playerTeleport', event.player.name);
// Uncomment to stop it from happening. // event.cancel = true;});Properties
Section titled “Properties”player
Section titled “player”read-only
readonly player: Player;Types
fromLocation
Section titled “fromLocation”read-only
readonly fromLocation: Vector3;Types
toLocation
Section titled “toLocation”toLocation: Vector3;Types
read-only
readonly cause: "Plugin" | "Command" | "EnderPearl";Used by
Section titled “Used by”WorldBeforeEvents.playerTeleport
Inherited
Section titled “Inherited”From CancellableEvent: cancel