본문 바로가기

커맨드

아이템 액자 뒤의 상자 편하게 여는 커맨드

 

아이템 액자를 상자에 붙여쓰다보면 상자 열기가 힘듭니다.

NBT 수정으로 아이템 액자를 투명하게 만들거나 리소스팩으로 아이템 액자 크기를 줄일 수도 있지만 히트박스는 그대로 남아있기때문에 별 효과가 없습니다.

아머스탠드에는 Marker라는 NBT가 있는데 이 값을 1로 바꾸면 히트박스가 사라집니다.

이걸 이용하여 아이템은 상자앞에 붙이고 상자는 쉽게 열 수 있도록 해보겠습니다.

 

커맨드 블록으로 제작

갑옷거치대에 붙이는 아이템 종류에 따라 위치가 다릅니다.

크게 블록류랑 아이템류로 나뉘는데 전부 다 위치를 맞출 수 없어서 아이템류를 기준으로 위치를 맞췄습니다.

커맨드를 한 방향으로 설치 후 다음 커맨드를 입력합니다.

 

[ 반복형 / 무조건적 / 항상 활성화 ]

execute as @e[type=minecraft:item_frame,nbt={Rotation:[90.0f,0.0f],Item:{Count:1b}}] at @s if block ~1 ~ ~ minecraft:chest run summon armor_stand ~0.25 ~-2.25 ~ {Rotation:[270f,0f],ArmorItems:[{},{},{},{id:"snowball",Count:1b}],HandItems:[{},{}],Invisible:1b,Marker:1b,Tags:["frame"]}

아이템이 걸려있는 아이템 액자 뒤에 상자가 있으면 투명한 갑옷거치대를 소환하고 태그를 붙입니다.

 

 

[ 연쇄형 / 조건적 / 항상 활성화 ]

execute as @e[type=minecraft:item_frame] at @s positioned ~0.25 ~-2.25 ~ run data modify entity @e[tag=frame,distance=..0.1,sort=nearest,limit=1] ArmorItems[3] set from entity @s Item

아이템 액자의 아이템을 갑옷거치대 머리에 붙입니다.

 

 

[ 연쇄형 / 조건적 / 항상 활성화 ]

execute as @e[type=minecraft:item_frame] at @s positioned ~0.25 ~-2.25 ~ if entity @e[tag=frame,distance=..0.1] run kill @s

아이템 액자를 제거합니다.

 

 

한 방향 제작이 끝났습니다. 나머지 세 방향도 좌표와 각도를 바꿔서 설치합니다.

더보기
execute as @e[type=minecraft:item_frame,nbt={Rotation:[180.0f,0.0f],Item:{Count:1b}}] at @s if block ~ ~ ~1 minecraft:chest run summon armor_stand ~ ~-2.25 ~0.25 {Rotation:[0f,0f],ArmorItems:[{},{},{},{id:"snowball",Count:1b}],HandItems:[{},{}],Invisible:1b,Marker:1b,Tags:["frame"]}
execute as @e[type=minecraft:item_frame] at @s positioned ~ ~-2.25 ~0.25 run data modify entity @e[tag=frame,distance=..0.1,sort=nearest,limit=1] ArmorItems[3] set from entity @s Item
execute as @e[type=minecraft:item_frame] at @s positioned ~ ~-2.25 ~0.25 if entity @e[tag=frame,distance=..0.1] run kill @s
execute as @e[type=minecraft:item_frame,nbt={Rotation:[270.0f,0.0f],Item:{Count:1b}}] at @s if block ~-1 ~ ~ minecraft:chest run summon armor_stand ~-0.25 ~-2.25 ~ {Rotation:[90f,0f],ArmorItems:[{},{},{},{id:"snowball",Count:1b}],HandItems:[{},{}],Invisible:1b,Marker:1b,Tags:["frame"]}
execute as @e[type=minecraft:item_frame] at @s positioned ~-0.25 ~-2.25 ~ run data modify entity @e[tag=frame,distance=..0.1,sort=nearest,limit=1] ArmorItems[3] set from entity @s Item
execute as @e[type=minecraft:item_frame] at @s positioned ~-0.25 ~-2.25 ~ if entity @e[tag=frame,distance=..0.1] run kill @s
execute as @e[type=minecraft:item_frame,nbt={Rotation:[0.0f,0.0f],Item:{Count:1b}}] at @s if block ~ ~ ~-1 minecraft:chest run summon armor_stand ~ ~-2.25 ~-0.25 {Rotation:[180f,0f],ArmorItems:[{},{},{},{id:"snowball",Count:1b}],HandItems:[{},{}],Invisible:1b,Marker:1b,Tags:["frame"]}
execute as @e[type=minecraft:item_frame] at @s positioned ~ ~-2.25 ~-0.25 run data modify entity @e[tag=frame,distance=..0.1,sort=nearest,limit=1] ArmorItems[3] set from entity @s Item
execute as @e[type=minecraft:item_frame] at @s positioned ~ ~-2.25 ~-0.25 if entity @e[tag=frame,distance=..0.1] run kill @s

 

 

[ 반복형 / 무조건적 / 항상 활성화 ]

execute as @e[tag=frame,limit=1] at @s positioned ~ ~2.25 ~ unless block ~ ~ ~ minecraft:chest run kill @s

마지막으로 갑옷거치대에 상자가 없을 경우 갑옷거치대를 제거합니다.

 

 

데이터팩으로 제작

나중에

'커맨드' 카테고리의 다른 글

홀로라이브 대운동회 2021 무궁화 꽃이 피었습니다 제작  (0) 2021.12.05
execute  (0) 2021.11.17