I'm trying to create an item that teleports the player to their spawn point when right clicked but I can't figure out how to access that data.
ItemEvents.rightClicked(event => {
const item = event.item;
const player = event.player;
const playerName = player.name;
if(item.id == 'kubejs:magic_mirror'){
const spawnPoint = player.getSomething(); //???
const spawnDimension = player.getSomething(); //???
event.runCommand('execute in ' + spawnDimension + ' run tp ' + playerName + ' ' + spawnPoint);
}
});```
If I were to run vanilla command to retrieve the data I'd just do `data get entity @s SpawnX` (...Y, Z, Dimension).
I have been at this for a couple hours and can't figure out how to retrieve this data using kubejs. Any help appreciated!