WorldQL / mammoth

Scale a single world horizontally across multiple Minecraft servers.
https://www.worldql.com/posts/2021-08-worldql-scalable-minecraft/
MIT License
857 stars 47 forks source link

Add command for teleporting one player to another, even if they are on different servers #65

Closed Jaxkr closed 2 years ago

Jaxkr commented 2 years ago

Why? In slice mode, players on the same world will be on different servers and it can be extremely difficult to teleport to one another as the Minecraft server executing the command may not know the location of the players.

A solution is a new command: /mtp <target-player> <destination-player>. It could work like this on a high level

  1. Alice is on server A and Bob is on server B. Alice issues /tp Alice Bob
  2. Server A sends a GlobalMessage with replication IncludingSelf with parameter “MinecraftTeleportPositionLookup“ and a flex field including Alice’s in the target field and Bob in the destination.
  3. Server B receives this message, looks up Bob’s location, and creates a similar message with parameter “MinecraftTeleport” including Alice’s name and bob’s location.
  4. Server A receives this and teleports Alice to the provided coordinates.
Jaxkr commented 2 years ago

works gr8