Skip to content

Teleport

LLytho edited this page Oct 21, 2022 · 4 revisions

Teleport

This event is used to detect teleports through ender pearls or chorus fruits.
The event can be cancelled to prevent the teleportation.

// for 1.18 pls use: onEvent("morejs.teleport", (event) => { ... })
MoreJSEvents.teleport((event) => {
    /**
     * `event.entity`: Entity that is teleported
     * `event.type`: Type of the teleport. Either "ender_pearl" or "chorus_fruit"
     * `event.x`: X coordinate of the teleport. Can be set.
     * `event.y`: Y coordinate of the teleport. Can be set.
     * `event.z`: Z coordinate of the teleport. Can be set.
     */
});
Clone this wiki locally