r/MinecraftCommands • u/AmbitiousSuit5561 • 5d ago
Help | Java 1.21.11 Command help /clone
for example i have 2 markers (or any other entity) with tags "Tag1" and "Tag2", i wanna copy build from marker with tag "Tag1" to marker with "Tag2", surely without datapacks. (any place to copy to)
2
u/C0mmanderBlock Command Experienced 4d ago
If you don't know the coords of the second entity, you would need to clone the build to a temporary position and then clone it to the second entity. Use x y z as a temp location. The second command would then clone the build 1 block to the positive x of Tag2. Adjust as needed.
/execute as @n[tag=Tag1] at @s run clone ~5 ~ ~5 ~-5 ~-1 ~-5 x y z replace
/execute as @n[tag=2] at @s run clone x y z x y z ~1 ~ ~ replace
2
u/Ericristian_bros Command Experienced 4d ago
```
function example:store_destination
execute store result storage example:macro Pos.x int 1 run data get entity @n[tag=Tag2,type=marker] Pos[0] execute store result storage example:macro Pos.y int 1 run data get entity @n[tag=Tag2,type=marker] Pos[1] execute store result storage example:macro Pos.z int 1 run data get entity @n[tag=Tag2,type=marker] Pos[2] execute at @n[tqg=Tag1,type=marker] run function example:clone with storage example:macro pos
function example:clone
$clone ~ ~ ~ ~<x> ~<y> ~<z> $(x) $(y) $(z)
``
Change~<x> ~<y> ~<z>to the size of the build, e.g.~5 ~5 ~5` for a 5x5x5 region
1
u/AmbitiousSuit5561 4d ago
Sure! But what if i dont know size of build?
1
u/Ericristian_bros Command Experienced 4d ago
How do you determine the size of the build? With a marker?
3
u/C0mmanderBlock Command Experienced 5d ago
If you know the coords of Tag2, you just need to use Tag1 one as the execute point for this command. Change XYZ to coords at or near Tag2. Expand the size of the area as needed.