This is a simple utility you can copy into your Paper/Spigot plugin to add a cinematic, GTA-style teleport effect for players. Itโs not a standalone plugin or full API just a class you can reuse.
-
Smoothly moves the playerโs camera in 3 stages:
- Rises up to a high point.
- Slides horizontally to the destination.
- Descends to the target Y level.
-
Uses ease-in-out quadratic motion for smoothness.
-
Teleports the player to the destination at the end.
-
Temporarily switches them into Spectator mode, then restores their gamemode.
- Copy
Camera.kt
(and supporting enums/utilities) into your pluginโs source. - Call the
MoveCameraTask
directly when you want to animate a teleport:
// Example usage
val destination = Location(Bukkit.getWorld("world2"), -734.0, 113.0, 1449.0, 0f, 90f)
player.gameMode = GameMode.SPECTATOR
Camera.CameraCommand.MoveCameraTask(
player,
destination,
player,
TeleportAnimation.instance
).runTaskTimer(TeleportAnimation.instance, 0, 1)
- The task will run automatically and complete the cinematic teleport.
- Paper/Spigot 1.20+
- Java 17+
- Kotlin (if your plugin is written in Kotlin)
-
Designed as a drop-in util โ no config, no commands needed.
-
You can tweak values inside
MoveCameraTask
:highPoint
โ how high the camera risesduration
โ speed of each stageepsilon
โ threshold for ending a stage
- Add fade-to-black transitions.
- Support
Player#setCamera
instead of Spectator mode (Paper 1.20.5+). - Configurable easing functions for different cinematic feels.