Skip to content

Instantly share code, notes, and snippets.

@Cadiboo
Created January 6, 2020 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cadiboo/7782819faf49c40d389dfb7b3cf35607 to your computer and use it in GitHub Desktop.
Save Cadiboo/7782819faf49c40d389dfb7b3cf35607 to your computer and use it in GitHub Desktop.
How to get to your Dimension in 1.14 (and probably in 1.13 and 1.15 too)
// By Commoble#9251
// https://discordapp.com/channels/176780432371744769/179315645005955072/661244291833790494 on the MMD Discord (https://discord.mcmoddev.com/)
// How to get to your Dimension in 1.14 (and probably in 1.13 and 1.15 too)
public static void teleportPlayerToDimension(ServerPlayerEntity player, DimensionType destinationType, BlockPos destinationPos) {
ServerWorld nextWorld = player.getServer().getWorld(destinationType);
nextWorld.getChunk(destinationPos); // Make sure the chunk is loaded
player.teleport(nextWorld, destinationPos.getX(), destinationPos.getY(), destinationPos.getZ(), player.rotationYaw, player.rotationPitch);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment