0

I am making a map on Minecraft 1.17.1 and I'm tying to make a challenge where you need to go through the correct tunnel, if you go through the wrong one you'll get teleported to the start.

I don't know how to do it, so I "tried" using the execute command but I don't know how to really use it.

1
  • I'm not someone that develops lots of things in MC but wouldn't it work to just have a pressure plate that when pressed throws a command that sends a command that tps your player?
    – Fredy31
    Commented Oct 5, 2021 at 18:18

1 Answer 1

1

This can be easily achieved with a command block and the tp command:

tp @p[distance=..4] x y z

Where x, y, and z are the respective coordinates of your starting position.


Give yourself a command block with:

give @s command_block

Place it where it can be concealed (e.g. under a block in the tunnel) and set it's configuration to:

  • Block Type: Repeat
  • Condition: Unconditional
  • Redstone: Always Active
  • Command Input: tp @p[distance=..4] x y z
    • Where x, y, and z are the respective coordinates of your starting position.
4
  • This is a minecraft-java-edition question. You seem to have posted a Bedrock Edition screenshot, and a command that hasn't worked on Java Edition since 1.13.
    – pppery
    Commented Oct 6, 2021 at 22:39
  • @pppery oops, in my multi-tasking state I failed to swap the syntax over. The UI for the command block, IIRC, is the same in Java edition though. However, I'm just going to remove it because I can't confirm for another few hours.
    – Taco
    Commented Oct 6, 2021 at 22:43
  • The correct java edition syntax is /tp @p[distance=..4] x y z. Whether you use /tp or /teleport doesn't matter.
    – pppery
    Commented Oct 7, 2021 at 0:03
  • @pppery thanks, I'm still new to Java edition; thanks for the clarity!
    – Taco
    Commented Oct 7, 2021 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.