개인 자료란 (JE)

  서버 커뮤니티

Profile mahapro 대표칭호 없음

djtakstar0908 475e497539874e479072ca2c27c2468d

Profile

커뮤니티 소통 개발하기 스크립트

스크립트 아시는법

2025.05.06 조회 수 575 추천 수 0

스크립트로 강화시스템을 만들었는데요。。(오류코드 안떳습니다)

every 1 second:

    loop all entities in world "world":

        if loop-entity-1 is item:

            set {_item1} to loop-entity-1

            loop all entities in world "world":

                if loop-entity-2 is item:

                    set {_item2} to loop-entity-2

                    if {_item1} is not {_item2}:

                        if distance between {_item1} and {_item2} is less than 0.5:

                            set {_i1} to item of {_item1}

                            set {_i2} to item of {_item2}

                            if {_i1} is wooden sword:

                                if {_i2} is diamond:

                                    set {_level} to 0

                                    

                                    # Check if lore exists and get the first lore length

                                    if lore of {_i1} is set:

                                        set {_level} to size of lore of {_i1}

                                    

                                    # 만약 lore이 비어있다면 기본값 0을 설정

                                    if lore of {_i1} is not set:

                                        set {_level} to 0


                                    if {_level} >= 10:

                                        broadcast "&c이미 최대 강화입니다!"

                                        delete {_item2}

                                        stop


                                    set {_chance} to 100 - {_level} * 10

                                    set {_roll} to random integer between 1 and 100


                                    if {_roll} <= {_chance}:

                                        # 강화 성공

                                        delete {_item1}

                                        delete {_item2}

                                        set {_newLevel} to {_level} + 1

                                        set {_stars} to "★" repeated {_newLevel} times

                                        drop 1 wooden sword named "&f+%{_newLevel}% 나무검" with lore "&e%{_stars}%" at location of {_item1}

                                        broadcast "&a강화 성공! +%{_newLevel}%강 나무검 생성!"

                                    else:

                                        set {_failRoll} to random integer between 1 and 100

                                        if {_failRoll} <= 50:

                                            # 파괴

                                            delete {_item1}

                                            delete {_item2}

                                            broadcast "&c강화 실패! 무기가 파괴되었습니다."

                                        else:

                                            # 하락

                                            delete {_item1}

                                            delete {_item2}

                                            set {_newLevel} to {_level} - 1

                                            if {_newLevel} < 0:

                                                set {_newLevel} to 0

                                            set {_stars} to "★" repeated {_newLevel} times

                                            drop 1 wooden sword named "&f+%{_newLevel}% 나무검" with lore "&e%{_stars}%" at location of {_item1}

                                            broadcast "&e강화 실패! 강화 수치가 감소했습니다."


위에가 코드입니다

1개의 댓글

LASK
2025.05.27

월드내 모든 엔티티 루프돌리시면 부하가 감당이 되나요

뉴스 및 창작물
/files/thumbnails/528/169/004/262x150.crop.jpg?20260301145407

건축

정신병원 탈출맵을 제작중이예요 :> 2

SHALDOPlus

2026-03-01

2

/files/thumbnails/472/161/004/262x150.crop.jpg?20260208155607

나의 GPU ☠️💀 3

SHALDOPlus

2026-02-08

0

/files/thumbnails/602/157/004/262x150.crop.jpg?20260130141854

상품

《마인크래프트 대탈출 게임 만들기》 출간!

다코미

2026-01-30

0

/files/thumbnails/873/156/004/262x150.crop.jpg?20260128131439

상품

《마인크래프트 블록 완벽 가이드》 출간!

다코미

2026-01-28

0

/files/thumbnails/317/150/004/262x150.crop.jpg?20260110144415

건축

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

창공

2026-01-10

2