command to open door
Hello
I've built a maze in minecraft education with some doors in it. I want to place an NPC near the door that would ask my students a question and only opens the door when the student answers correctly.
Does anyone know the command I need to place in the button's code window? if there's no such a command, is there another way to achieve this?
-
Great question mohamed a!
I would set up the following: An NPC with multiple buttons. A few for wrong answers, and one for the right answer.
There a lot of different ways of approaching this, but the easiest would work a little like this:
1. For the right answer use: /setblock ~ ~ ~ redstone_block - This will set the redstone block at coordinates you specify. If you're using an iron door, it should be placed one block underneath it. The door will remain open as long as the redstone block is present.
2. If you only want the door open briefly and close so the student can't go back, you might want to use a command block chain instead, which is a little more complex. I'd be happy to explain this more in depth. If you're interested, let me know.
Hope this helps!
2 -
Hi Dani, Thanks for your reply
I've tried your first solution and it works. I think this is what I need for the maze. I want my students to move forward towards the end if they answer the question provided by the NPC correctly!
I would be interested in seeing how the second solution would work too. I'm fairly new to Minecraft education. Thanks for your help :)
0
Please sign in to leave a comment.
Comments
3 comments