Skip to content

Instantly share code, notes, and snippets.

@Robijnvogel
Created January 19, 2017 03:50
Show Gist options
  • Save Robijnvogel/5a6f0838e28327bfc32ac3af707877ef to your computer and use it in GitHub Desktop.
Save Robijnvogel/5a6f0838e28327bfc32ac3af707877ef to your computer and use it in GitHub Desktop.
public static void teleport(Entity entity, Location location) {
PlayerList playerList = Minecraft.getMinecraft().getIntegratedServer().getPlayerList();
Teleporter tele = new TeleportHelper(location);
if (entity instanceof EntityPlayerMP) {
playerList.transferPlayerToDimension((EntityPlayerMP) entity, location.getDimensionID(), tele);
} else {
playerList.transferEntityToWorld(entity, entity.dimension, DimDoors.proxy.getWorldServer(entity.dimension), location.getWorld(), tele);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment