이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.16.5 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 최신 |
command /메뉴:
trigger:
open chest with 3 rows named "&8상점메뉴" to player
set slot 9 of current inventory of player to diamond named "&e&l광물상점"
set slot 11 of current inventory of player to diamond sword named "&e&l무기상점"
set slot 13 of current inventory of player to carrot named "&e&l식료품상점"
set slot 15 of current inventory of player to golden apple named "&e&l열매상점"
set slot 17 of current inventory of player to diamond chestplate named "&e&l옷상점"
set slot 3 of current inventory of player to barrier named "&e&l과일삭제"
set slot 5 of current inventory of player to netherite ingot named "&e&l블랙마켓"
on inventory click:
if inventory name is "&8상점메뉴":
cancel event
if clicked slot is 9:
execute player command "상점 열기 광물상점"
else if clicked slot is 11:
cancel event
execute player command "상점 열기 무기"
이렇게 작성하였는데 슬롯 11번을 누르면 무기상점이 열려야 하는데 광물상점이 열립니다
거너아나
2023.12.151. else if가 if inventory name.. 아래에 붙어있습니다
2. 상점 여는 것 같은 게 스크립트인 경우에는 execute 대신에 inventory로 여는 것이 더 좋습니다.