Skip to content

M | Utility: TeleportUtils

Sartaj Singh edited this page May 29, 2025 · 4 revisions

M | Utility: TeleportUtils

TeleportUtils enables advanced teleportation: delays, safety, particles, and cancellation.


1. teleportPlayer(Player player, Location location, int delayTicks, boolean particles, boolean sound, boolean safe)

What it does:
Teleports a player after a delay (in ticks), with optional particles, sounds, and a safety check (avoid lava, air, etc.).

Example:

TeleportUtils.teleportPlayer(player, target, 40, true, true, true);

Teleports after 2 seconds (40 ticks), with particles and sound, and only if the destination is safe.


2. cancelTeleport(Player player)

What it does:
Cancels any pending teleport for the player.

Example:

TeleportUtils.cancelTeleport(player);

Usage Patterns

  • Use when teleporting players to risky or far-away locations.
  • Use delay for "warmup" teleports (e.g., /home, /spawn).
  • Always enable safety for survival servers.

Clone this wiki locally