This module needs to be used with teleporttag
Each method in its teleporttag is used by kubejs
The following objects and methods are exported
TeleportTager.backhaul(player: Internal.ServerPlayer_); //teleport to home
TeleportTager.teleportPlayerToTheEnd(player: Internal.ServerPlayer_); //to the end
TeleportTager.teleportPlayerToOtherPlayer(player: Internal.ServerPlayer_); //to the other
TeleportTager.teleportPlayerToNetherOrBack(player: Internal.ServerPlayer_);//to nether or back
TeleportTager.teleportPlayerToDeathLocation(player: Internal.ServerPlayer_);
//to last death loc
You can add the following scripts to server_script:
PlayerEvents.tick((event) => {
const player = event.player;
const dimension = player.level.dimension;
if (dimension === 'minecraft:the_nether') {
TeleportTager.backhaul(player);
}
})