| 이해도 | 입문자 |
|---|---|
| 게임버전 (JE) | 1.21.3 |
| 게임버전 (BE) | 1.21.x |
뚜뚜형이 예전에 하던 컨텐츠 중에 조선전쟁이라는 컨텐츠가 있는데 그거랑 비슷하게 서버를 만들고 싶어요. 그래서 챗지피티랑 딥시크를 계속 쓰면서 코드를 짯는데 자꾸 whitespace어쩌구 그리고 integer어쩌구해서 안되서요...혹시 도와주실 분 있으실까요?
일단 현재까지 만든거:
① 팀 설정
블록 종류: 임펄스
조건: 없음
레드스톤: 필요
mcfunction
/team add Blue /team modify Blue color blue /team modify Blue displayName "블루팀" /team modify Blue friendlyFire false /team add Red /team modify Red color red /team modify Red displayName "레드팀" /team modify Red friendlyFire false
② 점수판 생성
블록 종류: 임펄스
조건: 없음
레드스톤: 필요
mcfunction
/scoreboard objectives add BlueDestroyed dummy /scoreboard objectives add RedDestroyed dummy /scoreboard objectives add BlueWin dummy /scoreboard objectives add RedWin dummy
③ 팀별 비콘 지급
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
execute as @a[team=Blue,tag=!hasBlueBeacon] run give @s minecraft:beacon 1 execute as @a[team=Blue,tag=!hasBlueBeacon] run tag @s add hasBlueBeacon execute as @a[team=Red,tag=!hasRedBeacon] run give @s minecraft:beacon 1 execute as @a[team=Red,tag=!hasRedBeacon] run tag @s add hasRedBeacon
④ 비콘 설치 감지 + 스폰포인트 설정
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
# 블루팀 비콘 설치 시 아머스탠드 생성 + 스폰 설정
execute as @a[team=Blue] at @s if block ~ ~-1 ~ minecraft:beacon unless entity @e[type=armor_stand,tag=BlueBeacon,distance=..10] run summon armor_stand ~ ~-1 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,Marker:1b,Tags:["BlueBeacon"]}
execute as @a[team=Blue] at @e[type=armor_stand,tag=BlueBeacon] run spawnpoint @a[team=Blue] ~ ~ ~
execute as @a[team=Blue] at @e[type=armor_stand,tag=BlueBeacon] run tellraw @a[team=Blue] {"text":"블루팀 스폰포인트가 새로 설정되었습니다!","color":"blue"}
# 레드팀 비콘 설치 시 아머스탠드 생성 + 스폰 설정
execute as @a[team=Red] at @s if block ~ ~-1 ~ minecraft:beacon unless entity @e[type=armor_stand,tag=RedBeacon,distance=..10] run summon armor_stand ~ ~-1 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,Marker:1b,Tags:["RedBeacon"]}
execute as @a[team=Red] at @e[type=armor_stand,tag=RedBeacon] run spawnpoint @a[team=Red] ~ ~ ~
execute as @a[team=Red] at @e[type=armor_stand,tag=RedBeacon] run tellraw @a[team=Red] {"text":"레드팀 스폰포인트가 새로 설정되었습니다!","color":"red"}⑤ 자기 팀 비콘 파괴 방지
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
# 블루팀
execute as @a[team=Blue] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run setblock ~ ~ ~ minecraft:beacon
execute as @a[team=Blue] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run tellraw @s {"text":"자기 팀의 비콘은 부술 수 없습니다!","color":"red"}
# 레드팀
execute as @a[team=Red] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run setblock ~ ~ ~ minecraft:beacon
execute as @a[team=Red] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run tellraw @s {"text":"자기 팀의 비콘은 부술 수 없습니다!","color":"red"}⑥ 적 팀 비콘 파괴 감지
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
# 블루팀이 레드팀 비콘 파괴
execute as @a[team=Blue] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run summon lightning_bolt ~ ~ ~
execute as @a[team=Blue] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run playsound minecraft:entity.generic.explode master @a
execute as @a[team=Blue] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run tellraw @a {"text":"블루팀이 레드팀의 비콘을 파괴했습니다!","color":"blue","bold":true}
execute as @a[team=Blue] at @e[type=armor_stand,tag=RedBeacon] if block ~ ~ ~ air run scoreboard players set global RedDestroyed 1
# 레드팀이 블루팀 비콘 파괴
execute as @a[team=Red] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run summon lightning_bolt ~ ~ ~
execute as @a[team=Red] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run playsound minecraft:entity.generic.explode master @a
execute as @a[team=Red] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run tellraw @a {"text":"레드팀이 블루팀의 비콘을 파괴했습니다!","color":"red","bold":true}
execute as @a[team=Red] at @e[type=armor_stand,tag=BlueBeacon] if block ~ ~ ~ air run scoreboard players set global BlueDestroyed 1⑦ 파괴된 팀 사망 처리
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
# 블루팀 비콘 파괴 시, 블루팀 플레이어가 죽으면 관전 모드
execute if score global BlueDestroyed matches 1 as @a[team=Blue,gamemode=survival] at @s run data get entity @s Health
execute if score global BlueDestroyed matches 1 as @a[team=Blue] at @s if entity @s[nbt={Health:0.0f}] run gamemode spectator @s
# 레드팀 비콘 파괴 시, 레드팀 플레이어가 죽으면 관전 모드
execute if score global RedDestroyed matches 1 as @a[team=Red,gamemode=survival] at @s run data get entity @s Health
execute if score global RedDestroyed matches 1 as @a[team=Red] at @s if entity @s[nbt={Health:0.0f}] run gamemode spectator @s⑧ 전멸 감시
블록 종류: 반복형
조건: 없음
레드스톤: 항상 활성화
mcfunction
execute if score global BlueDestroyed matches 1 unless entity @a[team=Blue,gamemode=!spectator] run scoreboard players set global RedWin 1 execute if score global RedDestroyed matches 1 unless entity @a[team=Red,gamemode=!spectator] run scoreboard players set global BlueWin 1
⑨ 승리 연출
블록 종류: 체인형
조건: 있음
레드스톤: 항상 활성화
mcfunction
# 블루팀 승리
execute if score global BlueWin matches 1 run tellraw @a {"text":"🎉 블루팀이 승리했습니다!","color":"blue","bold":true}
execute if score global BlueWin matches 1 run playsound minecraft:ui.toast.challenge_complete master @a
execute if score global BlueWin matches 1 run summon firework_rocket ~ ~2 ~ {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1,tag:{Fireworks:{Explosions:[{Type:1,Colors:[255],FadeColors:[65535]}]}}}}
# 레드팀 승리
execute if score global RedWin matches 1 run tellraw @a {"text":"🎉 레드팀이 승리했습니다!","color":"red","bold":true}
execute if score global RedWin matches 1 run playsound minecraft:ui.toast.challenge_complete master @a
execute if score global RedWin matches 1 run summon firework_rocket ~ ~2 ~ {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1,tag:{Fireworks:{Explosions:[{Type:1,Colors:[16711680],FadeColors:[16753920]}]}}}}

Sidite
10 일 전대체 어디서부터 수정해야할지 모를 정도로 오류 천국입니다.
LLM은 최신 버전에 '매우' 약하기에 차라리 위키를 읽는게 더 나을 지경입니다.
minelf
9 일 전제가 진짜 커맨드를 요번에 처음 해봐서 ai한테 시켰는데요.... 걍 ai한테 시키는건 포기하는게 좋겠죠?
Sidite
9 일 전네. AI한테 시키는건 권장하지 않습니다. AI는 최신 버전에 매우 약합니다.
minelf
8 일 전그러면 어떻게 하는게 좋을까요? 커맨드를 공부하기에는 시간이 좀 너무 오래 걸릴듯 하고 제가 코딩이나 그런 컴퓨터 쪽에 아에 접점이 없어서요
Sidite
8 일 전어쩔수 없습니다. 그 사람들도 위키보고 검색해서 자란 사람들입니다.
minelf
8 일 전도움을 받을수 있는 방법이 있을까요?? 제가 공부를 해서 커맨드를 짜는건 거의 불가능할거 같아서요..