Hey y'all,
I'm currently attempting to write a set of scripts that will give the player an item on respawn to teleport to their last death.
However, right now the item teleports you to the death before your last death.
Context:
I first get the player death location, then store it as persistent data. When the player respawns, they get an item with the death location as nbt. Finally, when the player uses the item, kubejs reads the item nbt to teleport the player.
The problem: If I check the nbt data on the item, it's pointing to the death before the latest death, rather than the latest.