Cinematic Door
This example will show you how to create a cinematic door that opens and closes with a sound effect.
Setup
First, we need to create the structures for the door opening, opened, and closed states. We will use vanilla commands to clone the structures to the door's location.
Taking the Coordinates
We need to take the coordinates that will be used to clone the structures to the door's location. We will use the /clone
command to copy the structures to the door's location.
First Corner
Second Corner
Destination
Final Commands
Door Opening
/clone from minecraft:overworld -3 102 -58 -4 97 -53 to minecraft:overworld 14 97 -58
Door Opened
/clone from minecraft:overworld -7 102 -58 -8 97 -53 to minecraft:overworld 14 97 -58
Door Closed
/clone from minecraft:overworld -10 102 -58 -11 97 -53 to minecraft:overworld 14 97 -58
Creating the Region
Now that we have the structures, we can create the region.
/rint create (name) (height) (radius)
You can see the created zone by activating hitboxes with the f3+b
key combination, or by using the /rint preview (name) [keep]
command.
Changing the Task Mode
We need to change the task mode to SINGLE
so the door can only be opened by one person at a time.
/rint taskmode (name)
Logic
Now we will think about the logic of the door.
Main thought process:
- Place the Door Opening structure
- Place the Door Opened structure
- Place the Door Closed structure
But we should also add a delay between the opening and closing of the door, so it doesn't close immediately after opening
- Let's add for example a second delay between the opening and opened status
- Let's add for example a 5 second delay between the opened and closing status
And why not, let's add a sound effect when the door opens and closes
To sum up:
- Place the Door Opening structure
- Play the door opening sound
- Wait 1 second
- Place the Door Opened structure
- Play the door opened sound
- Wait 5 seconds
- Place the Door Closed structure
- Play the door closing sound
Look up here to check all available Actions here.
Configuring the Actions
Now we will configure the actions for the door.
We will use /rint action add (name) (actionType) (action) to add the actions to the door.
List of actions:
Console
-clone from minecraft:overworld -3 102 -58 -4 97 -53 to minecraft:overworld 14 97 -58
Sound
-UI_TOAST_CHALLENGE_COMPLETE 1 0
Delay
-1
Console
-clone from minecraft:overworld -7 102 -58 -8 97 -53 to minecraft:overworld 14 97 -58
Sound
-BLOCK_CHEST_OPEN 1 0
Delay
-5
Console
-clone from minecraft:overworld -10 102 -58 -11 97 -53 to minecraft:overworld 14 97 -58
Sound
-BLOCK_CHEST_CLOSE 1 0
You can also use the menu in orderto configure everything, but here is an example of how to add the actions using the commands.
Extra
You could also add a child region to the door to make it so that the door can be opened from the inside and outside.
Creation
Now let's add a button, so it is understood that it can be interacted with. I will toggle the region to be able to build inside it.
/rint toggle (name)
Configuring the parent
Now we need to configure the parent region to be able to interact with the child region.
/rint setparent (childName) (parentName)
We now must set the sync settings needed to make the child region work properly.
For this case, we would like to synchronize the toggle
, running
and task mode
.
/rint setsync example-door-inside toggle true
/rint setsync example-door-inside running true
/rint setsync example-door-inside taskmode true