Through hours of experimentation and suggestions on this topic, I figured out a way to teleport anywhere on a map back to your spawnpoint without directly killing yourself.
Notes:
- Make a variable that is type, "deathCount". I used "tele" as the name.
- Enable the gamerule, "keepInventory"
The top-left CB checks if player has died with an invisibility effect: /effect @a[score_tele_min=1] 14 0
The bottom CB removes all items from any dead player, but the fact it has a delay allows the other CB to check first, enabling the players with the invisibility can travel back to their spawn with their items: /clear @a[score_tele_min=1]
The top-right CB simply "resets" the deaths, so that the mechanism no longer recognizes the players as "dead": /scoreboard players set @a[score_tele_min=1] tele 0
For use on my own server, I would use a "useless" item (golden shovel), and when used, will give you effects of invisibility and instant damage, making that item a "teleporter".
I hope you can expand from this idea, and I'm happy if this has helped you.
~[Picture]~
Notes:
- Make a variable that is type, "deathCount". I used "tele" as the name.
- Enable the gamerule, "keepInventory"
The top-left CB checks if player has died with an invisibility effect: /effect @a[score_tele_min=1] 14 0
The bottom CB removes all items from any dead player, but the fact it has a delay allows the other CB to check first, enabling the players with the invisibility can travel back to their spawn with their items: /clear @a[score_tele_min=1]
The top-right CB simply "resets" the deaths, so that the mechanism no longer recognizes the players as "dead": /scoreboard players set @a[score_tele_min=1] tele 0
For use on my own server, I would use a "useless" item (golden shovel), and when used, will give you effects of invisibility and instant damage, making that item a "teleporter".
I hope you can expand from this idea, and I'm happy if this has helped you.