2

Help with Block Displays

TheyCallMeFatbird 10/17/23 9:30 am
461
10/22/2023 8:20 am
I want to make a glass pane sliding door like the automatic ones irl with /execute so when they go near the coord it opens
Problem: I don't know how to do it


ty (On Java 1.20.1)
Posted by
TheyCallMeFatbird
Level 24 : Expert Birb
17

  Have something to say?

JoinSign in

5

imalittlhigh
10/21/2023 6:30 pm
Level 67 : High Grandmaster Sweetheart Stack
history
if you want to just move the display, you use translation "{width:1f,height:1f,transformation:{left_rotation:[​0f,0f,0f,1f],right_rotation:[​0f,0f,0f,1f],translation:[​90f,90f,90f],scale:[​1f,1f,1f]}}"

im not 100% sure what does what, but iirc translation is the offset of the display to the actual entity.
Scale is obv the scale (you can make them thin with it)

interpolation_duration:69

is how fast the display takes on the newly set translation (so opening the doors slowly with "animation"

you set the new translation by doing "/data modify entity @s ..." on the display entity

just trigger the opening if its not opened an a player is in range, trigger the closing if it isnt closed and no player is in range (how i would do it)

you can also set a specific nbt in the selector so: "/execute as @e[​type=minecraft:block_display] at @s if entity @a[​distance=..2] run"
would be "/execute as @e[​type=minecraft:block_display,nbt={width:1f,height:1f,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[​0f,0f,0f,1f],translation:[​90f,90f,90f],scale:[​1f,1f,1f]}}] at @s if entity @a[​distance=..2] run" would only run on the block displays that have that specific nbt ^^

if u need more help, feel free to hmu on disc


If youre having trouble with the nbt format, just summon entities with different values from mcstacker
2
TheyCallMeFatbird
10/22/2023 8:20 am
He/Him • Level 24 : Expert Birb
holy christ
1
WarnedCrayon509
10/21/2023 4:02 pm
He/Him • Level 4 : Apprentice Explorer
/execute as @e[type=minecraft:block_display] at @s if entity @a[distance=..2] run

will allow something to happen when a player gets near
3
WarnedCrayon509
10/21/2023 4:02 pm
He/Him • Level 4 : Apprentice Explorer
I don't know how to move them though
2
TheyCallMeFatbird
10/21/2023 5:30 pm
He/Him • Level 24 : Expert Birb
Oh wow that was so helpful!
Ty
2

Welcome