The ModZer0 Minecraft DNS teleport dance.
- 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. - clear player inventory
clear @p
- 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>
- reset player spawn to new world spawn location
spawnpoint
- teleport player to new spawn location
tp @p $WORLDSPAWN
OR
We do the crazy thing Walker figured out using command blocks.