개인 자료란 (JE)

  서버 커뮤니티

Profile 웅앵웅 대표칭호 없음
Profile

질문하기 스크립트

배열변수 하위 값들 감지하는 방법 질문

2025.12.07 조회 수 50 추천 수 0
이해도 중급자 
게임버전 (JE) 1.21.3 
게임버전 (BE) 관련없음 
스크립트 버전 2.12.2 

안녕하세요.

랜덤한 아이템을 지급하는 스크립트를 만드는 중에 특정 아이템만 나오지 않게 하고 싶어져서 구문을 작성 했습니다. (가장 아래쪽에 요약 있습니다)


command /ban_item [<int>]:

    trigger:

        if arg-1 is not set:

            send "{@sys} 번호를 정해주세요."

            stop

        open chest with 6 rows named "&8금지 아이템 %arg-1%번" to player

        wait 1 tick

        set {_slot} to 0

        loop {ban::%arg-1%::*}:

            set slot {_slot} of current inventory of player to loop-value

            add 1 to {_slot}


on inventory close:

    if name of player's current inventory contains "&8금지 아이템":

        set {_name} to name of player's current inventory

        set {_name} to uncolored {_name}

        replace all "금지" and "아이템" and "번" and " " with "" in {_name}

        set {_name} to {_name} parsed as integer

        delete {ban::%{_name}%::*}

        send "{@sys} 금지 아이템 %{_name}%번이 저장되었습니다"

        loop 54 times:

            add slot (loop-number)-1 of current inventory of player to {ban::%{_name}%::*}


/ban_item <숫자> 를 입력하면 "금지 아이템 <숫자>번" 이라는 이름의 6줄 상자 gui를 열고, 그 gui 안에 넣은 아이템들을 {ban::<숫자>::*} 배열 변수 안에 저장하는 방식 입니다. 제가 물어보고 싶은것은, 여기서 배열변수 안에 있는 모든 아이템들을 검사하는 방법이 있나요? 있다면 가르쳐주신다면 감사하겠습니다




1개의 댓글

windy_wind
2025.12.09

loop indices of {ban::*}:

@broadcast "%{ban::%loop-value}%"

 

 

뉴스 및 창작물
/files/thumbnails/317/150/004/262x150.crop.jpg?20260110144415

건축

광화문 구 경기도청사(1988)

KHC

2026-01-10

1

/files/thumbnails/144/149/004/262x150.crop.jpg?20260107110106

상품

《레고 마인크래프트 비주얼 딕셔너리》 출간!

다코미

2026-01-07

0

/files/thumbnails/384/148/004/262x150.crop.jpg?20260105141940

상품

《레고 마인크래프트 게임 아이디어 북》 출간!

다코미

2026-01-05

0

/files/thumbnails/018/142/004/262x150.crop.jpg?20251218163950

건축

마인크래프트 우주 수영장 [무료 다운로드]

SHALDOPlus

2025-12-18

0

/files/thumbnails/365/141/004/262x150.crop.jpg?20251215140757

상품

《마인크래프트 축제 아이디어 북》 출간!

다코미

2025-12-15

0