I'm making a box you can push around, but i want a dispenser for it that will dispense a new box when that one gets destroyed. i'm going to just teleport the box to the position when it touches a hazard, and am able to store the pos. i'm stuck on how to tp it to those coords i the objectives. I need multiple boxes at a time, but only one will get sent back at a time. i'm not going to hard code it in, as i want to create a user friendly editor. these are the commands i have so far:
put x into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[0] double 1 run scoreboard players get @s x_pos
put y into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[1] double 1 run scoreboard players get @s y_pos
put z into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[2] double 1 run scoreboard players get @s z_pos
the tp one is irrelevant as this command:</data get storage test:pos pos> returns an empty array.
I maybe didn't understand the full thing, but basically, if you have X,Y and Z score values that are the coords you want the box to be teleported at, you simply have to copy X score into box's Pos[0], Y score to Pos[1] and Z to Pos[2].
Thenthe game will move the box at its new position, as if it was teleported.
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I'm making a box you can push around, but i want a dispenser for it that will dispense a new box when that one gets destroyed. i'm going to just teleport the box to the position when it touches a hazard, and am able to store the pos. i'm stuck on how to tp it to those coords i the objectives. I need multiple boxes at a time, but only one will get sent back at a time. i'm not going to hard code it in, as i want to create a user friendly editor. these are the commands i have so far:
put x into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[0] double 1 run scoreboard players get @s x_pos
put y into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[1] double 1 run scoreboard players get @s y_pos
put z into test.pos: execute as @e[tag=cube,limit=1] store result storage test:pos pos[2] double 1 run scoreboard players get @s z_pos
the tp one is irrelevant as this command:</data get storage test:pos pos> returns an empty array.
I'm Also on 1.15
I maybe didn't understand the full thing, but basically, if you have X,Y and Z score values that are the coords you want the box to be teleported at, you simply have to copy X score into box's Pos[0], Y score to Pos[1] and Z to Pos[2].
Thenthe game will move the box at its new position, as if it was teleported.
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).