I am making a server, and I want to teleport the closest player to a certain area. But I don't know how to make the command blocks invisible, so the players don't see them. Does anyone know how?

  • Can you give us more information? Where are you trying to hide them - is it an open area or are there structures?
    – rivermont
    Commented Nov 4, 2016 at 2:22

3 Answers 3


You can have commandblocks somewhere else (however prefered in same chunk to have it loaded), then use alternative command syntax.

/tp @p[x=100,y=64,z=100,r=3] ~0 ~30 ~0

..this commandblock will look at given XYZ coordinates and will search for nearest player in radius of 3 blocks. Then it will teleport him 30 block up (relative to player in case of /tp - but you can use also hard-coded coordinates)

For activating the commandblock, you can make it always active (via CB settings or redstone clock), thus it will teleport players whenever they enter the scanned area. Or you can make some redstone circiut, or wireless redstone (via mods, plugins, or via another commandblocks - if you need some advanced computing and have only sparse space, you can use only one CB (with button-like activation) to just place redstone block on another place, then activating the circuits)

For more study how this works, you can read the wiki article about command syntax, what other target selectors you can use etc, here.

  • Expanding on your answer: You can use "wireless connected" levers and buttons. Just Place two command blocks under your lever, one inverted, with "setblock X Y Z redstone_block" and "setblock X Y Z air", where if you place a redstone block on X, Y, Z, the final command blocks will be triggered.
    – user143228
    Commented Nov 4, 2016 at 21:33
  • Placing command blocks in spawn chunks is usually the best option -- they will always be loaded.
    – user121753
    Commented Nov 6, 2016 at 6:06
  • 1
    1.13 syntax: /execute positioned as @e[x=100,y=64,z=100,distance=..3] run tp @s ~ ~30 ~. Why do relative teleports have to be so hard in 1.13?
    – pppery
    Commented Aug 17, 2018 at 13:43
  • /forceload add (chunk coordinates) as an alternative to using spawn chunks
    – user253608
    Commented Sep 13, 2020 at 16:37

Hide them under the ground, or if you have a pressure plate over said command block, you can move the command block a block lower and add a wool block over it along with the pressure plate.


You can use the Barrier block to cover the command block.

Barriers are not listed in the creative inventory (similarly to command blocks and structure blocks) and can only be obtained using commands, such as /give minecraft:barrier.
From: . After obtaining the barrier block, simply select the Barrier block and place it around the command block. How the Barrier block looks like and the properties of it can be found here: Barrier Block

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .