현빈63
대표칭호 없음
이해도 | 초보자 |
---|---|
게임버전 (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} # 현재체력 (칸)
이렇게 소환된 철골렘이 데미지를 받을 때 같은 팀에게 철골렘이 데미지를 받고 있다는 경고문을 작성하고 싶습니다
さくら
2023.02.25trigger:
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} # 현재체력 (칸)
제 방식대로 코드 추가 해봤는데요 이런걸 원하시는걸까요?