The ModZer0 Minecraft DNS teleport dance.

  1. clear player Enderchest using replaceitem
    replaceitem entity @p slot.enderchest.#
    (or not, since it was removed in 1.17 - so use item command
    item replace entity @p enderschest.# with air
    Although, this means I need to iterate and do that for all 0..26 slots? It appears so.
  2. clear player inventory
    clear @p
  3. reset target spawn area chunk
    possibly use the clone command
    clone from <sourceDimension> <begin: x y z> <end: x y z> <destination: x y z>
  4. reset player spawn to new world spawn location
    spawnpoint
  5. teleport player to new spawn location
    tp @p $WORLDSPAWN

OR

We do the crazy thing Walker figured out using command blocks.