Find an area where you want to build your secret door.
The side of a mountain or large hill
is the perfect place for a secret door.
It provides enough space to build the door,
and it's less likely anyone will find it.
But a secret door can be built anywhere.
Dig out two blocks where you want the entrance to be.
Start by creating a small room on the right
and place six sticky pistons next to each other
in the same way done here.
Then cover the gap in the middle.
Make a two-block space above the pistons
and add redstone in the same way shown.
Add a repeater between the redstone
and set it to one take
by right-clicking the repeater once.
The secret key that will open the door is a redstone torch.
Find a place outside where you want your key to be
in order to create the mechanism
that will open and close the door.
You can place the key wherever you want.
You just need to wire it up to the door.
After you place the torch, add a block on top of it.
Make sure not to destroy this block,
as it is very important in order for the door to work.
Dig a small room on the other side
and make your way to the torch.
Cover the gap between the redstone torch
and the small room and add redstone on top of it.
You will notice the redstone is activated.
Add a sticky piston and an observer next to it.
Make sure that the arrow on the observer is facing outwards.
Add another sticky piston and a redstone block
in front of the observer.
Make a way to connect the redstone
from the other side to this redstone block.
The door should immediately close
after everything has been connected.
Make your way outside and remove the redstone torch.
If you put the redstone torch back again,
the doors will open.
In order to close the door from the inside,
we will need to add a lock.
To do this, first remove the redstone torch.
Then add a button on the inside
and create a line of redstone
all the way to the sticky piston
next to the redstone that is connected to the torch outside.
By clicking this button,
you're able to open and close the door from the inside.
Make sure that you always remove
the redstone torch outside,
or else you won't be able to use the button.
And your secret door's finished.