So I'm trying to store a players coordinates in 3 scoreboards, if I just use these commands
I lose the decimals, since scoreboards can't store those. The solution for this would be to multiply the scores by, let's say 1000 to keep 3 decimals, then divide them again by 1000 when I need to use them.
So, my question is - how do I do this? I'm very new to operations and store, so I have no idea how to multiply the coordinates before putting them in the scoreboard, nor do I know how to use them to teleport a player (and divide them by 1000 before doing that)
execute store result score @a[scores={deathCountTP=1}] deathX run data get entity @s Pos[0]
execute store result score @a[scores={deathCountTP=1}] deathY run data get entity @s Pos[1]
execute store result score @a[scores={deathCountTP=1}] deathZ run data get entity @s Pos[2]I lose the decimals, since scoreboards can't store those. The solution for this would be to multiply the scores by, let's say 1000 to keep 3 decimals, then divide them again by 1000 when I need to use them.
So, my question is - how do I do this? I'm very new to operations and store, so I have no idea how to multiply the coordinates before putting them in the scoreboard, nor do I know how to use them to teleport a player (and divide them by 1000 before doing that)
3
Well I figured how to do the multiplying, just have to do
The only thing missing now is dividing it and teleporting a player there (..if that's even possible :p)
execute store result score @a[scores={deathCountTP=1}] deathX run data get entity @s Pos[0] 1000
execute store result score @a[scores={deathCountTP=1}] deathY run data get entity @s Pos[1] 1000
execute store result score @a[scores={deathCountTP=1}] deathZ run data get entity @s Pos[2] 1000The only thing missing now is dividing it and teleporting a player there (..if that's even possible :p)
Now, for the dividing I can do something like
This only works once, since it also devides the actual score in my scoreboard, but in my case that luckily isn't a problem (though I'm sure there's a workaround, using another scoreboard)
What now remains is the hardest question - how the hell do I get these 3 numbers into a teleport command, if I can even do that
/execute store result ??? run scoreboard players operation ShiruTheFox deathX /= #1000 constantThis only works once, since it also devides the actual score in my scoreboard, but in my case that luckily isn't a problem (though I'm sure there's a workaround, using another scoreboard)
What now remains is the hardest question - how the hell do I get these 3 numbers into a teleport command, if I can even do that
I eventually found a workaround by using an area effect cloud, setting the position of that effect cloud to the scoreboard coordinates, then teleporting the player to the effect cloud (meaning the chunk has to be forceloaded :P)
(if anyone reading this wants to know the exact fix lmk)
(if anyone reading this wants to know the exact fix lmk)
