개인 자료란 (JE)

  서버 커뮤니티

Profile 현빈63 대표칭호 없음
Profile

질문하기 스크립트

스크립트 질문

2023.02.24 조회 수 105 추천 수 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/761/908/003/262x150.crop.jpg?20241025153749

건축

서울 숭례문(崇禮門) 4

KHC

2024-10-25

2

/files/thumbnails/578/899/003/262x150.crop.jpg?20241010142350

건축

경주 월정교 1

KHC

2024-10-10

2

/files/thumbnails/219/899/003/262x150.crop.jpg?20241009200950

건축

송전탑+도시 2

dbasd12

2024-10-09

2

/files/thumbnails/246/898/003/262x150.crop.jpg?20241008102328

레드스톤

단다단 - 오토노케(オトノケ) | 마인크래프트 노트블럭 커버

노트블럭전문가

2024-10-08

1

/files/thumbnails/348/896/003/262x150.crop.jpg?20241006103035

디도스/봇테러등등을 낚는 방법 4

물귀신

2024-10-06

3