how do I get blocks to teleport in minecraft [closed]
i am building Jurassic Park in Minecraft and i want the huge gate like door/entrance to open and close when i pass over a piece of the rail in a minecart. I have no idea how to use the codes. Im trying to get the blocks to teleport 90 degrees and then back.
11 Answer
Blocks are static and cannot be teleported as entities. This means that you will have to manually animate the gate using /fill, /setblock and/or /clone. Take a look at this tutorial on how to animate builds:
.For the minecart detection, you can detect the minecart at some specific coordinates where the rails go:
/execute if entity @e[type=minecart,x=,y=,z=,distance=..1] run <trigger_animation>fill in the coordinates and replace "trigger_animation" with how you want to trigger your animation (the classic way is to /setblock a redstone block).