개인 자료란 (JE)

  서버 커뮤니티

Profile 현빈63 대표칭호 없음
Profile

질문하기 스크립트

스크립트 질문

2023.02.24 조회 수 62 추천 수 1
이해도 초보자 
게임버전 (JE) 1.19.2 
게임버전 (BE) 관련없음 

command /create-main-core:

    trigger:

        if player is op:

            spawn iron golem at player with nbt nbt compound from "{CustomName:'{""text"":""Main-Core""}', NoAI:1b, Team:%team of player%, ActiveEffects:[{Id:11,Amplifier:2,Duration:20000000,ShowParticles:0b},{Id:10,Amplifier:0,Duration:20000000,ShowParticles:0b}]}"

            set {_spawn} to the last spawned entity

            set {_spawn}'s max health to {main-Core-Max-Health} # 최대체력 (칸)

            set {_spawn}'s health to {main-Core-Max-Health} # 현재체력 (칸)

이렇게 소환된 철골렘이 데미지를 받을 때 같은 팀에게 철골렘이 데미지를 받고 있다는 경고문을 작성하고 싶습니다

1개의 댓글

さくら
2023.02.25

trigger:

    if player is op:

        spawn iron golem at player with nbt nbt compound from "{CustomName:'{""text"":""Main-Core""}', NoAI:1b, Team:%team of player%, ActiveEffects:[{Id:11,Amplifier:2,Duration:20000000,ShowParticles:0b},{Id:10,Amplifier:0,Duration:20000000,ShowParticles:0b}]}"

        set {_spawn} to the last spawned entity

        set {_spawn}'s max health to {main-Core-Max-Health} # 최대체력 (칸)

        set {_spawn}'s health to {main-Core-Max-Health} # 현재체력 (칸)

        loop all entities within 10 blocks of {_spawn}:

            if entity is a player:

                if entity is on {_spawn}'s team:

                    execute as entity

                        title @s actionbar {"text":"\u00A7c팀의 철골렘이 데미지 입었습니다~!","color":"dark_red"}

                        title @s title {"text":"\u00A7c팀의 철골렘이 데미지 입었습니다~!","color":"dark_red"}

                    execute as the entity end

            else if entity is a living entity:

                if entity is on {_spawn}'s team:

                    set entity's custom name to "TEAM A Main-Core"

                    set entity's glowing to true

                    set entity's noAI to true

                    set entity's team to {_spawn}'s team

                    set entity's max health to {main-Core-Max-Health} # 최대체력 (칸)

                    set entity's health to {main-Core-Max-Health} # 현재체력 (칸)

제 방식대로 코드 추가 해봤는데요 이런걸 원하시는걸까요?

뉴스 및 창작물
/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

1

/files/thumbnails/384/778/003/262x150.crop.jpg?20240512002324

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1