435: Automatic sliding doors. [Minecraft Map Making]

Subscribers:
4,070
Published on ● Video Link: https://www.youtube.com/watch?v=TvghKmXO05Q



Duration: 0:00
298 views
24


Membership:
Ep435: Automatic sliding doors that rotate to face the player when placed.

00:00 Intro

Version: 1.21

Command help: GalSergey

Commands, builds, hacks and ideas for people making their own Minecraft maps.

Check out my collabs on Coppit's channel:

The Discord server I am usually on: https://discord.gg/amU84KykEu

The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.

Since angled brackets are not allowed in YouTube descriptions you will have to replace "greater than" and "less than" with the appropriate angled bracket.

Commands used:

Setup:
IUN: scoreboard objectives add slide_door.state dummy
CUA: scoreboard objectives add slide_door.old_state dummy

Give:
IUN: give @p command_block[item_name='"Place: Double Sliding Door"',block_entity_data={id:"minecraft:command_block",auto:true,Command:"summon minecraft:block_display ^-0.5 ^0.5 ^ {transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.75f,0f,-0.5f],scale:[1f,2f,1f]},interpolation_duration:20,Tags:[\"slide_door\", \"left\"],block_state:{Name:\"minecraft:gray_stained_glass_pane\",Properties:{east:\"true\", west:\"true\"}},Passengers:[{id:\"minecraft:block_display\", interpolation_duration:20,Tags:[\"slide_door\", \"right\"], transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.75f,0f,-0.5f],scale:[1f,2f,1f]}, block_state:{Name:\"minecraft:gray_stained_glass_pane\",Properties:{east:\"true\", west:\"true\"}}}]}"}]

Controller - place:
Place
RUA: execute as @e[type=block_display,tag=slide_door,tag=right] unless score @s slide_door.state = @s slide_door.state store success score @s slide_door.state at @s align xyz positioned ~.5 ~ ~.5
summon area_effect_cloud facing entity @p eyes rotated ~ 0 positioned ^ ^ ^0.7071 align xyz positioned ~.5 ~ ~.5 facing entity @s eyes as @n[type=block_display,tag=slide_door,tag=right] positioned as @s run tp @s ~ ~ ~ ~ 0
CUA: execute as @e[type=block_display,tag=slide_door,tag=left] unless score @s slide_door.state = @s slide_door.state store success score @s slide_door.state at @s align xyz positioned ~.5 ~ ~.5
summon area_effect_cloud facing entity @p eyes rotated ~ 0 positioned ^ ^ ^0.7071 align xyz positioned ~.5 ~ ~.5 facing entity @s eyes as @n[type=block_display,tag=slide_door,tag=left] positioned as @s run tp @s ~ ~ ~ ~180 0

Controller - door:
RUA: execute as @e[type=block_display,tag=slide_door,tag=!locked] at @s store success score @s slide_door.state if entity @a[distance=..2,limit=1]
CUA: execute as @e[type=block_display,tag=slide_door] unless score @s slide_door.state = @s slide_door.old_state store success entity @s start_interpolation int 0 store success entity @s
transformation.translation[0] float 0.75 if score @s slide_door.state matches 1
CUA: execute as @e[type=block_display,tag=slide_door] unless score @s slide_door.state = @s slide_door.old_state at @s run playsound entity.breeze.inhale master @a ~ ~ ~ 0.2 0.7
CUA: execute as @e[type=block_display,tag=slide_door] run scoreboard players operation @s slide_door.old_state = @s slide_door.state