0

I'm very new to Minecraft commands and redstone, but I want to make a secret room by using the setblock command. This is what I have so far but it won't work for me. Can someone make or teach me how to use this command?

/setblock 272.302 62.60809 303.300 oak_wood_plank

Should this work? I also want another command block to replace the planks with air and I think I know how to do that, but I'm not so sure but if someone could help me out it would be very appreciated!

  • Are you attempting to use command blocks to hide the entrance to your secret room? – IronAnvil Aug 6 '17 at 15:18
3

You wouldn't want to use setblock.

A command block can only hold one command, so it can /setblock in only one place. Take this command:

/setblock -124 45 -246 minecraft:stone

That command would take up one whole command block, and only place one block at the position (-124, 45, -246). The better option would to be the /fill command. Consider this:

/fill -124 45 -246 -150 50 -246 minecraft:stone

This command would fill stone blocks from the point of (-124, 45, -246) to (-150, 50, -246), effectively generating a stone wall. You'd need 12 command blocks (one for each wall, the roof and the floor to generate the walls, and 6 more to fill them with whatever block surrounds the room) plus one for each other block you have in the room, but it's a far cry from the 500+ you'd need if you were using the /setblock command.

Approaching the problem

We know what commands we're going to use now, so let's get the coordinates of the walls. Go to where you plan your first wall to start and click F3, or FN + F3 if you're on a laptop.

enter image description here

Find the circled line on your computer and write down the numbers after Block:. These are the coordinates you will use first. Now fly up to where you want the end of your wall to be and write down those coordinates too.

Place down a command block where you want your secret room entrance to be and put the following command inside:

/fill (Coordinates 1) (Coordinates 2) minecraft:planks 0 replace

Place down another command block after it, possibly using a repeater:

/fill (Coordinates 1) (Coordinates 2) minecraft:air replace

Now repeat the steps from the beginning of this section for each of the walls, roof and floor. Once you've done that, you've finished! Here's a bird's eye view of how the command blocks should look:

enter image description here

All the bottom ones are the /fill wood planks and the top ones /fill air.

  • 1
    Your last two commands are setblock commands but indicate two sets of coordinates. I am guessing you meant for those to be fill commands. – IronAnvil Aug 6 '17 at 15:24
  • @IronAnvil Thanks, I didn't notice that. – rappatic Aug 6 '17 at 16:49
  • Just to point it out, you can use the hollow option for [oldBlockHandling] if the walls are all the same stone. Try /fill ~1 ~ ~1 ~6 ~5 ~6 minecraft:stone 0 hollow to demonstrate. – IronAnvil Aug 8 '17 at 16:00
0

All you need to do is put a command block under a block and do /execute @a ~ ~2 ~ tp @p (x,y,z)(and then for x,y,z put on the cords for you room) then when people walk over the spot they'll be teleported to your room p.s this is also hidden so it can be used for a trap!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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