개인 자료란 (JE)

  서버 커뮤니티

Profile file 대표칭호 없음

djtakstar0908 475e497539874e479072ca2c27c2468d

Profile

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

스크립트 아시는법

14 일 전 조회 수 291 추천 수 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강화 실패! 강화 수치가 감소했습니다."


위에가 코드입니다

Warning
댓글이 없습니다.

새로운 댓글을 등록해 주세요!

뉴스 및 창작물
/files/thumbnails/166/043/004/262x150.crop.jpg?20250514021103

업데이트

마인크래프트 자바 스냅숏 25w20a 한국어 번역본 (Minecraft Snapshot 25w20a)

updater

2025-05-14

0

/files/thumbnails/255/028/004/262x150.crop.jpg?20250507010930

업데이트

마인크래프트 자바 스냅숏 25w16a 한국어 번역본 (Minecraft Snapshot 25w16a)

updater

2025-04-16

0

/files/thumbnails/036/025/004/262x150.crop.jpg?20250411144649

업데이트

마인크래프트 자바 스냅숏 25w15a 한국어 번역본 (Minecraft Snapshot 25w15a)

updater

2025-04-09

1

/files/thumbnails/159/021/004/262x150.crop.jpg?20250402093702

업데이트

광산제작 업데이트 (The Craftmine 업데이트): 한국어 번역본

updater

2025-04-02

0

/files/thumbnails/729/017/004/262x150.crop.jpg?20250326233109

업데이트

마인크래프트 자바 1.21.5 출시 (Minecraft Java 1.21.5 Released): 한국어 번역본

updater

2025-03-26

0