From 8fc4f164ae39603b7fb9be45a837b58bdd223404 Mon Sep 17 00:00:00 2001 From: tkrmagid-desktop Date: Tue, 19 May 2026 02:38:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/func/function/num_list.mcfunction | 1 + .../data/func/function/shuffle/f1.mcfunction | 2 +- .../data/func/function/text_list.mcfunction | 1 + .../func/function/text_list/f1.mcfunction | 1 + .../minecraft/tags/dialog/quick_actions.json | 2 +- .../data/mq/function/answer/judge.mcfunction | 1 + .../function/answer/normalize/step.mcfunction | 4 +- .../data/mq/function/commands/hint.mcfunction | 1 + .../mq/function/commands/replay.mcfunction | 1 + .../data/mq/function/commands/skip.mcfunction | 1 + .../mq/function/commands/start.mcfunction | 31 +++++ .../data/mq/function/commands/stop.mcfunction | 15 +- .../data/mq/function/commands/test.mcfunction | 1 + .../data/mq/function/images/clear.mcfunction | 2 +- .../data/mq/function/init/buttons.mcfunction | 28 +++- .../data/mq/function/init/config.mcfunction | 13 +- .../data/mq/function/init/songs.mcfunction | 67 +++------ music_quiz/data/mq/function/load.mcfunction | 18 +++ .../data/mq/function/players/login.mcfunction | 9 ++ .../data/mq/function/quiz/select.mcfunction | 2 + .../mq/function/quiz/setanswer.mcfunction | 11 +- .../mq/function/repeat/buttons/btn.mcfunction | 131 +++++++++++++++--- .../repeat/buttons/btn_prep.mcfunction | 21 +++ .../repeat/buttons/handler.mcfunction | 33 ++++- .../data/mq/function/repeat/timer.mcfunction | 40 +----- .../function/repeat/timers/init10.mcfunction | 3 + .../function/repeat/timers/init2.mcfunction | 15 ++ .../function/repeat/timers/init6.mcfunction | 15 ++ .../repeat/triggers/handler.mcfunction | 1 + music_quiz/data/mq/function/tick.mcfunction | 1 + .../data/mq/painting_variant/cover_01.json | 6 +- .../data/mq/painting_variant/cover_02.json | 6 +- .../data/mq/painting_variant/cover_03.json | 6 +- .../data/mq/painting_variant/cover_04.json | 6 +- .../data/mq/painting_variant/cover_05.json | 6 +- .../data/mq/painting_variant/cover_06.json | 6 +- .../data/mq/painting_variant/cover_07.json | 6 +- .../data/mq/painting_variant/cover_08.json | 6 +- .../data/mq/painting_variant/cover_09.json | 6 +- .../data/mq/painting_variant/cover_10.json | 6 +- .../data/mq/painting_variant/cover_11.json | 6 +- .../data/mq/painting_variant/cover_12.json | 6 +- .../data/mq/painting_variant/cover_13.json | 6 +- .../data/mq/painting_variant/cover_14.json | 6 +- .../data/mq/painting_variant/cover_15.json | 6 +- .../data/mq/painting_variant/cover_16.json | 6 +- .../data/mq/painting_variant/cover_17.json | 6 +- .../data/mq/painting_variant/cover_18.json | 5 - .../data/mq/painting_variant/cover_19.json | 5 - .../data/mq/painting_variant/cover_20.json | 5 - .../data/mq/painting_variant/cover_21.json | 5 - .../data/mq/painting_variant/cover_22.json | 5 - .../data/mq/painting_variant/cover_23.json | 5 - .../data/mq/painting_variant/cover_24.json | 5 - .../data/mq/painting_variant/cover_25.json | 5 - .../data/mq/painting_variant/cover_26.json | 5 - .../data/mq/painting_variant/cover_27.json | 5 - .../data/mq/painting_variant/cover_28.json | 5 - .../data/mq/painting_variant/cover_29.json | 5 - .../data/mq/painting_variant/cover_30.json | 5 - .../data/mq/painting_variant/cover_31.json | 5 - .../data/mq/painting_variant/cover_32.json | 5 - .../data/mq/painting_variant/cover_33.json | 5 - .../data/mq/painting_variant/cover_34.json | 5 - .../data/mq/painting_variant/cover_35.json | 5 - .../data/mq/painting_variant/cover_36.json | 5 - .../data/mq/painting_variant/cover_37.json | 5 - .../data/mq/painting_variant/cover_38.json | 5 - .../data/mq/painting_variant/cover_39.json | 5 - .../data/mq/painting_variant/cover_40.json | 5 - .../data/mq/painting_variant/cover_41.json | 5 - .../data/mq/painting_variant/cover_42.json | 5 - .../data/mq/painting_variant/cover_43.json | 5 - .../data/mq/painting_variant/cover_44.json | 5 - .../data/mq/painting_variant/cover_45.json | 5 - .../data/mq/painting_variant/cover_46.json | 5 - .../data/mq/painting_variant/cover_47.json | 5 - .../data/mq/painting_variant/cover_48.json | 5 - .../data/mq/painting_variant/cover_49.json | 5 - .../data/mq/painting_variant/cover_50.json | 5 - music_quiz/data/mq/painting_variant/gif.json | 6 +- music_quiz/pack.mcmeta | 7 +- 82 files changed, 401 insertions(+), 351 deletions(-) create mode 100644 music_quiz/data/mq/function/repeat/buttons/btn_prep.mcfunction create mode 100644 music_quiz/data/mq/function/repeat/timers/init10.mcfunction create mode 100644 music_quiz/data/mq/function/repeat/timers/init2.mcfunction create mode 100644 music_quiz/data/mq/function/repeat/timers/init6.mcfunction delete mode 100644 music_quiz/data/mq/painting_variant/cover_18.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_19.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_20.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_21.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_22.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_23.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_24.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_25.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_26.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_27.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_28.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_29.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_30.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_31.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_32.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_33.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_34.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_35.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_36.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_37.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_38.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_39.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_40.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_41.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_42.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_43.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_44.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_45.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_46.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_47.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_48.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_49.json delete mode 100644 music_quiz/data/mq/painting_variant/cover_50.json diff --git a/music_quiz/data/func/function/num_list.mcfunction b/music_quiz/data/func/function/num_list.mcfunction index 55c5d9f..21892e2 100644 --- a/music_quiz/data/func/function/num_list.mcfunction +++ b/music_quiz/data/func/function/num_list.mcfunction @@ -3,6 +3,7 @@ data modify storage func:temp zero set value 0 $data modify storage func:temp length set value $(length) execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"} +# warn-off execute-group execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"} execute if score result func.temp matches 1 run return 0 diff --git a/music_quiz/data/func/function/shuffle/f1.mcfunction b/music_quiz/data/func/function/shuffle/f1.mcfunction index 0f2f0fe..de32939 100644 --- a/music_quiz/data/func/function/shuffle/f1.mcfunction +++ b/music_quiz/data/func/function/shuffle/f1.mcfunction @@ -5,7 +5,7 @@ execute if score length func.temp matches 0 run return 1 execute store result score random func.temp run random value 0..2147483646 scoreboard players operation random func.temp %= length func.temp -execute run function func:shuffle/f2 with storage func:temp {index:0} +function func:shuffle/f2 with storage func:temp {index:0} execute store result storage func:temp shuffle.index int 1 run scoreboard players get random func.temp function func:shuffle/f2 with storage func:temp shuffle diff --git a/music_quiz/data/func/function/text_list.mcfunction b/music_quiz/data/func/function/text_list.mcfunction index 1d21dcb..6df013e 100644 --- a/music_quiz/data/func/function/text_list.mcfunction +++ b/music_quiz/data/func/function/text_list.mcfunction @@ -3,6 +3,7 @@ data modify storage func:temp zero set value 0 $data modify storage func:temp length set value $(length) execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"} +# warn-off execute-group execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"} execute if score result func.temp matches 1 run return 0 diff --git a/music_quiz/data/func/function/text_list/f1.mcfunction b/music_quiz/data/func/function/text_list/f1.mcfunction index 12fbad7..83735bc 100644 --- a/music_quiz/data/func/function/text_list/f1.mcfunction +++ b/music_quiz/data/func/function/text_list/f1.mcfunction @@ -3,6 +3,7 @@ execute store result score result func.temp run function func:is_space with stor $execute store result score result2 func.temp run function func:is_index {l1:"half",l2:"result",index:$(index)} +# warn-off execute-group execute if score result2 func.temp matches 0 if score result func.temp matches 0 run data modify storage func:temp text_list append value "■" execute if score result2 func.temp matches 0 if score result func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text execute if score result2 func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text diff --git a/music_quiz/data/minecraft/tags/dialog/quick_actions.json b/music_quiz/data/minecraft/tags/dialog/quick_actions.json index 8e4c352..c92ab02 100644 --- a/music_quiz/data/minecraft/tags/dialog/quick_actions.json +++ b/music_quiz/data/minecraft/tags/dialog/quick_actions.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "mq:answer" + { "id": "mq:answer", "required": false } ] } diff --git a/music_quiz/data/mq/function/answer/judge.mcfunction b/music_quiz/data/mq/function/answer/judge.mcfunction index 31a898c..ed2ac7a 100644 --- a/music_quiz/data/mq/function/answer/judge.mcfunction +++ b/music_quiz/data/mq/function/answer/judge.mcfunction @@ -9,6 +9,7 @@ data modify storage mq:tmp judge.answer set from storage mq:tmp norm.acc function mq:answer/macro/match with storage mq:tmp judge # 2) 제목 매치 실패 시 alias 들과 순차 비교 (조기 종료) +# warn-off execute-group execute unless score @s answer matches 1 run data modify storage mq:tmp aliases set from storage mq:main answer.alias execute unless score @s answer matches 1 run function mq:answer/iter_aliases diff --git a/music_quiz/data/mq/function/answer/normalize/step.mcfunction b/music_quiz/data/mq/function/answer/normalize/step.mcfunction index 2a01dfd..6ed25a6 100644 --- a/music_quiz/data/mq/function/answer/normalize/step.mcfunction +++ b/music_quiz/data/mq/function/answer/normalize/step.mcfunction @@ -5,7 +5,7 @@ execute store result score n.len func.temp run data get storage mq:tmp norm.in execute if score n.len func.temp matches 0 run return 0 # 머리글자 추출 → norm.c -data modify storage mq:tmp norm.c set string from storage mq:tmp norm.in 0 1 +data modify storage mq:tmp norm.c set string storage mq:tmp norm.in 0 1 # 공백 제거 (스킵) execute if data storage mq:tmp norm{c:" "} run data modify storage mq:tmp norm.c set value "" @@ -42,6 +42,6 @@ execute if data storage mq:tmp norm{c:"Z"} run data modify storage mq:tmp norm.c function mq:answer/normalize/append with storage mq:tmp norm # 나머지로 진행 -data modify storage mq:tmp norm.in set string from storage mq:tmp norm.in 1 +data modify storage mq:tmp norm.in set string storage mq:tmp norm.in 1 function mq:answer/normalize/step diff --git a/music_quiz/data/mq/function/commands/hint.mcfunction b/music_quiz/data/mq/function/commands/hint.mcfunction index 34a2173..8d7bf4a 100644 --- a/music_quiz/data/mq/function/commands/hint.mcfunction +++ b/music_quiz/data/mq/function/commands/hint.mcfunction @@ -5,6 +5,7 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'} execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'} +# warn-off execute-group execute if score init main matches 5 run data modify storage mq:main hint.text set from storage mq:main answer.title execute if score init main matches 5 run data modify storage mq:main hint.hint set value "" execute if score init main matches 5 run function func:hint with storage mq:main hint diff --git a/music_quiz/data/mq/function/commands/replay.mcfunction b/music_quiz/data/mq/function/commands/replay.mcfunction index 59383f1..e17c115 100644 --- a/music_quiz/data/mq/function/commands/replay.mcfunction +++ b/music_quiz/data/mq/function/commands/replay.mcfunction @@ -5,5 +5,6 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'} execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'} +# warn-off execute-group execute if score init main matches 5 run function mq:quiz/stop_sound execute if score init main matches 5 run function mq:quiz/play_sound diff --git a/music_quiz/data/mq/function/commands/skip.mcfunction b/music_quiz/data/mq/function/commands/skip.mcfunction index 4f91855..7082fad 100644 --- a/music_quiz/data/mq/function/commands/skip.mcfunction +++ b/music_quiz/data/mq/function/commands/skip.mcfunction @@ -5,5 +5,6 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'} execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'} +# warn-off execute-group execute if score init main matches 5 run scoreboard players set skip buttons -2 execute if score init main matches 5 run function mq:quiz/correct diff --git a/music_quiz/data/mq/function/commands/start.mcfunction b/music_quiz/data/mq/function/commands/start.mcfunction index d2a7220..8e08a05 100644 --- a/music_quiz/data/mq/function/commands/start.mcfunction +++ b/music_quiz/data/mq/function/commands/start.mcfunction @@ -1,5 +1,36 @@ execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 완전히 종료된후 시작해주세요.","color":"red","msg":""} +# ---- 외부 모드 설치 검증 ---- +# 두 모드는 성격이 달라서 검증 방식이 다름: +# +# * mq_chat_mod : mc_chat_answer_mod = 서버 전용 모드 (채팅 가로채기는 +# 서버에서 일어남, 클라 설치 불필요). 따라서 fake player `#server` +# 점수를 모드가 매 server tick 마다 1 로 set. 서버에 모드가 없으면 +# 이 점수가 갱신되지 않음. +# +# * mq_video_mod : mc_video_player_mod = 클라이언트 측 렌더링 + 서버 측 +# 컴포넌트. 같은 objective 안에 holder 두 종류 사용: +# - `#server mq_video_mod` : 서버 컴포넌트가 매 tick 1 로 갱신 (server +# presence). 없으면 0 → 서버에 모드 미설치. +# - ` mq_video_mod` : 클라 join 시 payload 가 서버로 오면 서버 +# 컴포넌트가 해당 플레이어 점수를 1 로 set (client presence). 클라 +# 미설치면 0 유지. +# 이렇게 분리해야 "서버 미설치"와 "특정 플레이어 클라 미설치"가 안내에서 +# 구분된다. +# +# 1) 서버 측 모드 부재 — 전원 차단, 단일 안내. 서버 부재는 클라 검사보다 +# 우선해야 — 클라가 다 설치되어 있어도 서버가 없으면 동작 안 한다. +execute unless score #server mq_chat_mod matches 1 run return run function mq:tellraw {"text":"채팅정답 모드가 서버에 미설치 — 서버 관리자에게 문의해주세요.","color":"red","msg":""} +execute unless score #server mq_video_mod matches 1 run return run function mq:tellraw {"text":"영상재생 모드가 서버에 미설치 — 서버 관리자에게 문의해주세요.","color":"red","msg":""} + +# 2) 클라이언트 측 모드 (mc_video_player_mod) 부재 — 본인 누락 안내 + 차단. +# selector `scores={X=..0}` 는 점수 미존재를 매치하지 않으므로 직전에 +# `add @a ... 0` 으로 materialize. 개인 안내는 tellraw @s 직접 (mq:tellraw +# 는 내부 @a broadcast 라 부적합). +scoreboard players add @a mq_video_mod 0 +execute as @a[scores={mq_video_mod=..0}] run tellraw @s ["",{"text":"영상재생 모드 미설치 — 모드 적용 후 다시 입장해주세요.","color":"red"}] +execute if entity @a[scores={mq_video_mod=..0}] run return run function mq:tellraw {"text":"필수 모드 미설치 플레이어가 있어 시작할 수 없습니다.","color":"red","msg":""} + setblock ~ ~ ~ minecraft:air function mq:quiz/stop_sound diff --git a/music_quiz/data/mq/function/commands/stop.mcfunction b/music_quiz/data/mq/function/commands/stop.mcfunction index f328905..c7c2864 100644 --- a/music_quiz/data/mq/function/commands/stop.mcfunction +++ b/music_quiz/data/mq/function/commands/stop.mcfunction @@ -60,12 +60,17 @@ bossbar set mq:process visible false bossbar set mq:process style notched_10 bossbar set mq:process players @a -# 대기 상태 marker 1개만 소환 (answer.title="음악퀴즈" 가 sentinel) +# 대기 상태로 answer 초기화 data modify storage mq:main answer set value {title:"음악퀴즈", alias:[]} -data modify storage mq:tmp marker_call set from storage mq:main marker -data modify storage mq:tmp marker_call.name set value "음악퀴즈" -data modify storage mq:tmp marker_call.alias set value [] -function mq:quiz/macro/summon with storage mq:tmp marker_call + +# 이전 버전이 남긴 legacy marker 정리 (현재는 marker 사용 안 함) +kill @e[distance=0..,tag=mq,type=minecraft:marker] + +# 이전 버전이 남긴 잔존 text_display 정리. +# 현재 버튼은 -1 init 단계에서 같은 tag interaction 만 kill 하므로 (n 태그 +# 가 일치할 때만), 옛 버튼 정의에 있던 이름의 text_display 가 남으면 안 +# 지워짐. 여기서 mq 태그 전체를 한 번에 정리해 stale 제거. +kill @e[distance=0..,tag=mq,type=minecraft:text_display] function mq:quiz/stop_sound function mq:images/clear diff --git a/music_quiz/data/mq/function/commands/test.mcfunction b/music_quiz/data/mq/function/commands/test.mcfunction index 2e3d15d..4e2d178 100644 --- a/music_quiz/data/mq/function/commands/test.mcfunction +++ b/music_quiz/data/mq/function/commands/test.mcfunction @@ -1,5 +1,6 @@ stopsound @a block minecraft:block.stone_button.click_on function mq:tellraw {"text":"띵!!!","color":"white","msg":'""'} +# warn-off execute-group execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9 execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9 execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9 diff --git a/music_quiz/data/mq/function/images/clear.mcfunction b/music_quiz/data/mq/function/images/clear.mcfunction index 01210ae..a6a000d 100644 --- a/music_quiz/data/mq/function/images/clear.mcfunction +++ b/music_quiz/data/mq/function/images/clear.mcfunction @@ -1 +1 @@ -kill @e[type=minecraft:painting,tag=mq_cover] +kill @e[distance=0..,tag=mq_cover,type=minecraft:painting] diff --git a/music_quiz/data/mq/function/init/buttons.mcfunction b/music_quiz/data/mq/function/init/buttons.mcfunction index 5b7f752..9c3876a 100644 --- a/music_quiz/data/mq/function/init/buttons.mcfunction +++ b/music_quiz/data/mq/function/init/buttons.mcfunction @@ -1,7 +1,23 @@ +# 버튼 정의. 각 항목 의미: +# n : 이름 (= 트리거/태그) +# x,y,z : 버튼 블록 좌표 +# f : facing (south / north / east / west) +# c : 클릭 시 실행 명령 (init=0 직접, 그 외 trigger $(n) 투표) +# +# optional 필드 (버튼 아래 y-1 위치에 같은 벽면 라벨 부착): +# label : 표시할 텍스트. 생략하면 라벨 없음. +# label_color : 텍스트 색 (예 "black", "red", "#FFAA00"). 기본 "black". +# label_font : 텍스트 폰트 (예 "minecraft:default"). 기본 "minecraft:default". +# label_scale : 텍스트 크기 (Vector3f 한 축, 3축 동일). 기본 "1.0". +# +# interaction entity 의 위치/크기와 text_display 의 위치/회전은 facing 만 +# 보면 결정됨 — 매번 손으로 ox/oy/oz 를 적지 않는다. 실제 오프셋 테이블은 +# repeat/buttons/btn 안에서 한 곳에만 정의되어 있다. + data modify storage mq:main button_defs set value [] -data modify storage mq:main button_defs append value {n:"start", x:140, y:62, z:-225, f:"south", c:"function mq:commands/start with storage mq:main"} -data modify storage mq:main button_defs append value {n:"stop", x:142, y:62, z:-225, f:"south", c:"function mq:commands/stop with storage mq:main"} -data modify storage mq:main button_defs append value {n:"skip", x:144, y:62, z:-225, f:"south", c:"function mq:commands/skip"} -data modify storage mq:main button_defs append value {n:"hint", x:146, y:62, z:-225, f:"south", c:"function mq:commands/hint"} -data modify storage mq:main button_defs append value {n:"replay", x:148, y:62, z:-225, f:"south", c:"function mq:commands/replay"} -data modify storage mq:main button_defs append value {n:"test", x:144, y:62, z:-213, f:"north", c:"function mq:commands/test"} +data modify storage mq:main button_defs append value {n:"start", x:2773, y:86, z:5968, f:"north", c:"function mq:commands/start with storage mq:main", label:"게임시작"} +data modify storage mq:main button_defs append value {n:"stop", x:2771, y:86, z:5968, f:"north", c:"function mq:commands/stop with storage mq:main", label:"정지"} +data modify storage mq:main button_defs append value {n:"skip", x:2769, y:86, z:5968, f:"north", c:"function mq:commands/skip", label:"넘기기"} +data modify storage mq:main button_defs append value {n:"hint", x:2767, y:86, z:5968, f:"north", c:"function mq:commands/hint", label:"힌트"} +data modify storage mq:main button_defs append value {n:"replay", x:2765, y:86, z:5968, f:"north", c:"function mq:commands/replay", label:"다시듣기"} +data modify storage mq:main button_defs append value {n:"test", x:2769, y:87, z:5957, f:"south", c:"function mq:commands/test", label:"소리 테스트"} diff --git a/music_quiz/data/mq/function/init/config.mcfunction b/music_quiz/data/mq/function/init/config.mcfunction index b1fde5d..53240d6 100644 --- a/music_quiz/data/mq/function/init/config.mcfunction +++ b/music_quiz/data/mq/function/init/config.mcfunction @@ -2,22 +2,21 @@ data modify storage mq:main title set value "음악퀴즈" # 플레이어 접속 시 텔레포트 위치 (x y z, r=yaw, f=pitch) -data modify storage mq:main spawn set value {x: 144, y: 61, z: -219, r: 180, f: 0} +data modify storage mq:main spawn set value {x: 2769, y: 85, z: 5963, r: 0, f: 0} # 음원 재생 — minecraft_launcher 리소스팩의 musicquiz:track_NN 사운드 이벤트 # namespace — 리소스팩 네임스페이스 (기본 "musicquiz") -# source — /playsound 채널. stopsound 와 동일해야 함 (기본 "weather") +# source — /playsound 채널. stopsound 와 동일해야 함. 노래는 "player" 채널로 +# 재생 (음성/플레이어 채널 슬라이더로 음량 제어). 타이머/UI 비프는 +# 별도로 weather 채널 사용. # volume — 기본 음량. 곡별 override 는 init/songs.mcfunction 의 volume 필드 사용 # pitch — 1.0 = 원본 속도 -data modify storage mq:main audio set value {namespace: "musicquiz", source: "weather", volume: 1.0, pitch: 1.0} +data modify storage mq:main audio set value {namespace: "musicquiz", source: "player", volume: 1.0, pitch: 1.0} # 정답 페인팅 — 데이터팩의 mq:cover_NN painting_variant (텍스처는 리소스팩 musicquiz:cover_NN) # namespace — painting_variant 네임스페이스 (기본 "mq") # x,y,z — 페인팅 entity 좌표 (벽면 앞쪽 블록 위치) # facing — 페인팅이 바라보는 방향: south=0 / west=1 / north=2 / east=3 -data modify storage mq:main image set value {namespace: "mq", x: 144, y: 84, z: -261, facing: 0b} - -# 정답 입력용 marker entity 소환 좌표 -data modify storage mq:main marker set value {x: 144, y: 59, z: -219} +data modify storage mq:main image set value {namespace: "mq", x: 2775, y: 85, z: 5982, facing: 2b} # 곡 개수 max_index 는 init/songs.mcfunction 의 길이로 자동 계산됨 diff --git a/music_quiz/data/mq/function/init/songs.mcfunction b/music_quiz/data/mq/function/init/songs.mcfunction index 4a8d063..8cc9c0a 100644 --- a/music_quiz/data/mq/function/init/songs.mcfunction +++ b/music_quiz/data/mq/function/init/songs.mcfunction @@ -4,56 +4,23 @@ # 곡 순서가 리소스팩의 track_NN / cover_NN 인덱스와 1:1 매칭된다. # 예) {title:"Quiet Song", author:"...", alias:[...], volume:2.0} data modify storage mq:main songs set value [] -data modify storage mq:main songs append value {title:"Lose My Mind", author:"Don Toliver", alias:["루즈 마이 마인드","루스 마이 마인드","ㅣㅐㄴㄷ ㅡㅛ ㅡㅑㅜㅇ"], volume:1.0} -data modify storage mq:main songs append value {title:"The Chase", author:"Hearts2Hearts", alias:["더 체이즈","더 체이스","솓 촘ㄴㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"HOT SAUCE", author:"BABYMONSTER", alias:["핫 소스","ㅙㅅ ㄴ면ㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"Golden", author:"HUNTR/X", alias:["골든"," 해ㅣㅇ두"], volume:1.0} -data modify storage mq:main songs append value {title:"돌림판", author:"머쉬베놈", alias:["Spin the wheel"], volume:1.0} -data modify storage mq:main songs append value {title:"OVERDRIVE", author:"TWS", alias:["오버드라이브","ㅐㅍㄷㄱㅇ걒ㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"눈물참기", author:"QWER", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"깨어", author:"tripleS", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"like JENNIE", author:"제니", alias:["라이크 제니","라익 제니","라잌 제니","ㅣㅑㅏㄷ ㅓ두ㅜㅑㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"Rich Man", author:"aespa", alias:["리치 맨","갸초 ㅡ무"], volume:1.0} -data modify storage mq:main songs append value {title:"I DO ME", author:"KiiiKiii", alias:["아이 두 미","아 두 미","ㅑ 애 ㅡㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"SIGN", author:"izna", alias:["사인","냐후"], volume:1.0} -data modify storage mq:main songs append value {title:"WICKED", author:"ALLDAY PROJECT", alias:["위키드","쟈찯ㅇ"], volume:1.0} -data modify storage mq:main songs append value {title:"Good Thing", author:"i-dle", alias:["굿 띵","굳 띵","해ㅐㅇ 소ㅑㅜㅎ"], volume:1.0} -data modify storage mq:main songs append value {title:"0+0", author:"한로로", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"HANDS UP", author:"MEOVV", alias:["핸즈 업","핸스 업","ㅗ뭉ㄴ ㅕㅔ"], volume:1.0} -data modify storage mq:main songs append value {title:"Blue Valentine", author:"NMIXX", alias:["블루 발렌타인","ㅠㅣㅕㄷ ㅍ미두샤ㅜㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"Flower", author:"오반", alias:["플라워","리ㅐㅈㄷㄱ"], volume:1.0} -data modify storage mq:main songs append value {title:"Soda Pop", author:"Saja Boys", alias:["소다 팝","냉ㅁ ㅔㅐㅔ"], volume:1.0} -data modify storage mq:main songs append value {title:"REBEL HEART", author:"IVE", alias:["레블 하트","ㄱ듀디 ㅗㄷㅁㄳ"], volume:1.0} -data modify storage mq:main songs append value {title:"GO!", author:"CORTIS", alias:["고","고!","GO","해","해!"], volume:1.0} -data modify storage mq:main songs append value {title:"BEEP", author:"izna", alias:["빕","삡","ㅠㄷ데"], volume:1.0} -data modify storage mq:main songs append value {title:"Pookie", author:"FIFTY FIFTY", alias:["푸키","ㅔㅐㅐㅏㅑㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"DAISIES", author:"Justin Bieber", alias:["데이지즈","데이지스","ㅇ먀냗ㄴ"], volume:1.0} -data modify storage mq:main songs append value {title:"빌려온 고양이", author:"ILLIT", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"TOO BAD", author:"OfficialGDRAGON", alias:["투 배드","투 밷","새ㅐ ㅠㅁㅇ"], volume:1.0} -data modify storage mq:main songs append value {title:"시작의 아이", author:"마크툽", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"STYLE", author:"Hearts2Hearts", alias:["스타일","ㄴ쇼ㅣㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"Good Goodbye", author:"화사", alias:["굿 굿바이","굳 굳바이","해ㅐㅇ 해ㅐ유ㅛㄷ"], volume:1.0} -data modify storage mq:main songs append value {title:"너에게 닿기를", author:"10CM", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"IRIS OUT", author:"Kenshi Yonezu", alias:["아이리스 아웃","이리스 아웃","ㅑ갼 ㅐㅕㅅ"], volume:1.0} -data modify storage mq:main songs append value {title:"Sugar On My Tongue", author:"Tyler, The Creator", alias:["슈가 온 마이 텅","슈가 온 마 텅","녛ㅁㄱ ㅐㅜ ㅡㅛ 새ㅜ혇"], volume:1.0} -data modify storage mq:main songs append value {title:"Hollywood Action", author:"BOYNEXTDOOR", alias:["할리우드 액션","ㅙㅣㅣㅛ재ㅐㅇ ㅁㅊ샤ㅐㅜ"], volume:1.0} -data modify storage mq:main songs append value {title:"SPAGHETTI", author:"LE SSERAFIM", alias:["스파게티","넴혿ㅅ시"], volume:1.0} -data modify storage mq:main songs append value {title:"Gabriela", author:"KATSEYE", alias:["가브리엘라","ㅎ뮤갸딤"], volume:1.0} -data modify storage mq:main songs append value {title:"LIKE YOU BETTER", author:"프로미스나인", alias:["라이크 유 베터","라이크 유 베럴","라잌 유 베터","라잌 유 베럴","ㅣㅑㅏㄷ ㅛㅐㅕ ㅠㄷㅅㅅㄷㄱ"], volume:1.0} -data modify storage mq:main songs append value {title:"뛰어", author:"BLACKPINK", alias:["jump"], volume:1.0} -data modify storage mq:main songs append value {title:"CHANEL", author:"Tyla", alias:["샤넬","초무디"], volume:1.0} -data modify storage mq:main songs append value {title:"오늘만 I LOVE YOU", author:"BOYNEXTDOOR", alias:["오늘만 아이 러브 유","오늘만 ㅑ ㅣㅐㅍㄷ ㅛㅐㅕ"], volume:1.0} -data modify storage mq:main songs append value {title:"earthquake", author:"지수", alias:["어스퀘이크","얼스퀘이크","ㄷㅁㄱ소벼맏","보만다 지진"], volume:1.0} -data modify storage mq:main songs append value {title:"윽!", author:"염따", alias:["윽"], volume:1.0} -data modify storage mq:main songs append value {title:"Abracadabra", author:"Lady Gaga", alias:["아브라카다브라","뮥ㅁㅊㅁㅇ뮥ㅁ"], volume:1.0} -data modify storage mq:main songs append value {title:"멸종위기사랑", author:"이찬혁", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"Dirty Work", author:"aespa", alias:["더티 워크","덜티 워크","더티 월크","덜티 월크","약쇼 재가"], volume:1.0} -data modify storage mq:main songs append value {title:"HOT", author:"LE SSERAFIM", alias:["핫","ㅙㅅ"], volume:1.0} -data modify storage mq:main songs append value {title:"FAMOUS", author:"ALLDAY PROJECT", alias:["페이머스","ㄹ므ㅐㅕㄴ"], volume:1.0} -data modify storage mq:main songs append value {title:"XOXZ", author:"IVE", alias:["엑스 오 엑스 지","엑스 오 엑스 제트","탵ㅋ"], volume:1.0} -data modify storage mq:main songs append value {title:"여름이었다", author:"H1-KEY", alias:[], volume:1.0} -data modify storage mq:main songs append value {title:"LOV3", author:"식케이", alias:["럽3","ㅣㅐㅍ3"], volume:1.0} -data modify storage mq:main songs append value {title:"Drive", author:"Ed Sheeran", alias:["드라이브","ㅇ걒ㄷ"], volume:1.0} +data modify storage mq:main songs append value {title:"푸르던", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"금요일에 만나요", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"나의 옛날이야기", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"비밀의 화원", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"겨울잠", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"이런엔딩", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"이름에게", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"드라마", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"가을아침", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"Rain Drop", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"에필로그", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"무릎", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"마음", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"잠 못 드는 밤 비는 내리고", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"정거장", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"자장가", author:"아이유", alias:[]} +data modify storage mq:main songs append value {title:"사랑이 지나가면", author:"아이유", alias:[]} # 곡 개수는 songs 배열 길이에서 자동 계산됨 execute store result storage mq:main max_index int 1 run data get storage mq:main songs diff --git a/music_quiz/data/mq/function/load.mcfunction b/music_quiz/data/mq/function/load.mcfunction index 9845e29..3daef27 100644 --- a/music_quiz/data/mq/function/load.mcfunction +++ b/music_quiz/data/mq/function/load.mcfunction @@ -21,6 +21,24 @@ scoreboard objectives add buttons dummy scoreboard objectives add answer dummy scoreboard objectives add leave_game custom:leave_game +# 외부 모드 존재 확인용 점수. +# mq_chat_mod : 서버 전용 모드(mc_chat_answer_mod). 모드가 매 server tick +# 마다 fake player `#server` 점수를 1 로 set. 모드가 서버에 없으면 0 유지. +# mq_video_mod : 클라이언트 모드(mc_video_player_mod). 클라 join 시 서버로 +# handshake payload 전송 → 서버 측 모드가 해당 플레이어 점수를 1 로 set. +# 클라에 모드가 없으면 0 유지. (login.mcfunction 에서 플레이어별 0 초기화.) +scoreboard objectives remove mq_chat_mod +scoreboard objectives remove mq_video_mod +scoreboard objectives add mq_chat_mod dummy +scoreboard objectives add mq_video_mod dummy +# /reload 후 모드가 한 tick 도 돌기 전에 start 가 호출될 수 있으니 +# #server 점수도 0 으로 materialize. 모드가 살아 있으면 다음 tick 에 1 로 갱신. +# mq_video_mod 도 같은 objective 안에서 holder 만 다르게 — `#server` 는 서버 +# 컴포넌트 존재 (서버 측 모드가 매 tick 1 로 갱신), `` 는 클라 측 +# 존재 (payload 수신 시 1 로 갱신). +scoreboard players set #server mq_chat_mod 0 +scoreboard players set #server mq_video_mod 0 + scoreboard players set two func.temp 2 bossbar add mq:process [{"text":"진행도: ","color": "yellow","bold": true},{"text":"0","color": "yellow","bold": true},{"text":"/","color": "yellow","bold": true},{"text":"0","color": "yellow","bold": true}] diff --git a/music_quiz/data/mq/function/players/login.mcfunction b/music_quiz/data/mq/function/players/login.mcfunction index 226bec4..0c90af8 100644 --- a/music_quiz/data/mq/function/players/login.mcfunction +++ b/music_quiz/data/mq/function/players/login.mcfunction @@ -1,6 +1,15 @@ tag @s add player scoreboard players reset @s leave_game +# 외부 모드 검증 점수 초기화 (per-player 검증 대상만). +# mq_video_mod : 클라이언트 모드(mc_video_player_mod) 가 join 시 handshake +# payload 를 서버로 보내면 서버 모드가 해당 플레이어 점수를 1 로 set 한다. +# 여기서 0 으로 미리 깔아 두면 handshake 가 없는 플레이어는 0 유지 → +# start 가드 차단. handshake 가 오면 곧바로 1 로 갱신됨. +# mq_chat_mod 는 서버 전용 모드라 fake player(#server) 로 검증 — per-player +# 초기화 불필요. +scoreboard players set @s mq_video_mod 0 + title @s times 10t 80t 10t title @s subtitle "" title @s title "" diff --git a/music_quiz/data/mq/function/quiz/select.mcfunction b/music_quiz/data/mq/function/quiz/select.mcfunction index 317ba0a..8941965 100644 --- a/music_quiz/data/mq/function/quiz/select.mcfunction +++ b/music_quiz/data/mq/function/quiz/select.mcfunction @@ -1,5 +1,7 @@ scoreboard players set timer main 0 +stopsound @a player + execute if score index main >= max_index main run return run function mq:quiz/end with storage mq:main scoreboard players add index main 1 diff --git a/music_quiz/data/mq/function/quiz/setanswer.mcfunction b/music_quiz/data/mq/function/quiz/setanswer.mcfunction index 1bf71b3..d2234ae 100644 --- a/music_quiz/data/mq/function/quiz/setanswer.mcfunction +++ b/music_quiz/data/mq/function/quiz/setanswer.mcfunction @@ -1,26 +1,19 @@ # songs[$(idx)] → answer 로 복사하고, 트랙/커버 id 부여 function mq:quiz/macro/setanswer with storage mq:tmp -# 정답 marker entity 소환 (좌표 + name/alias 합쳐서 macro 호출) -data modify storage mq:tmp marker_call set from storage mq:main marker -data modify storage mq:tmp marker_call.name set from storage mq:main answer.title -data modify storage mq:tmp marker_call.alias set from storage mq:main answer.alias -function mq:quiz/macro/summon with storage mq:tmp marker_call - scoreboard players set stop buttons -1 scoreboard players set skip buttons -1 scoreboard players set hint buttons -1 scoreboard players set replay buttons -1 # 이전 문제의 미처리 정답 입력 정리 + 새 문제의 input trigger 활성화 +# input trigger 는 유지 (mod 없는 환경에서 /trigger input 으로 dialog 열기 가능). +# 채팅 안내 메시지는 제거 — mc_chat_answer_mod 가 채팅 직접 입력을 처리함. data remove storage mq:input queue scoreboard players reset @a submit_seq scoreboard players set seq func.temp 0 scoreboard players enable @a input -# 정답 입력 안내 (클릭 시 trigger input → tick 에서 dialog 오픈) -function mq:tellraw {"text":"","color":"black",msg:[{"text":"[ 정답 입력 ]","color":"green","bold":true,"click_event":{"action":"run_command","command":"/trigger input set 1"},"hover_event":{"action":"show_text","value":{"text":"클릭하여 정답 입력창 열기","color":"gray"}}}]} - scoreboard players set init main 5 function mq:quiz/play_sound diff --git a/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction b/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction index 695e14b..d93ee18 100644 --- a/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction +++ b/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction @@ -1,28 +1,117 @@ +# warn-off-file always-pass-condition +# 버튼 1개에 대한 매 tick 처리. +# 매크로 인자(mq:tmp.btn): n, x, y, z, f, c, label, label_color, label_font, label_scale +# buttons 점수 상태: +# ..-2 : 비활성 (버튼 블록 제거, interaction 응답 차단) +# -1 : 초기화 단계 (버튼 블록 + interaction × 3 + text_display 보장 후 0) +# 0 : 정상 (interaction 클릭 대기) +# +# interaction/text_display entity 는 데이터팩이 직접 summon — /reload 시 +# commands/stop 에서 buttons 가 -1 로 재설정되어 다음 tick 에 ensure 로직 +# 실행. -1 단계에서 같은 태그 entity 를 모두 kill 후 정확한 개수만 다시 +# summon → 항상 idempotent (dup 누적 없음, 좌표/라벨 갱신 자동 반영). +# +# ---- facing → 머리 hitbox 위치 (이 파일 한 곳에서만 정의) ---- +# stone_button[face=wall, facing=X] AABB (블록 상대 좌표): +# facing 의 의미 = "버튼 머리 visible 면의 normal 방향". 머리는 그 방향 +# 쪽 face 에 붙어 있고 hitbox 는 그 face 에서 안쪽(1/8) 만큼 들어감. +# south : z ∈ [0, 0.125] 가로 x ∈ [0.3125, 0.6875] +# north : z ∈ [0.875, 1] 가로 x ∈ [0.3125, 0.6875] +# east : x ∈ [0, 0.125] 가로 z ∈ [0.3125, 0.6875] +# west : x ∈ [0.875, 1] 가로 z ∈ [0.3125, 0.6875] +# 세로 y ∈ [0.375, 0.625] 공통. +# +# interaction entity 의 horizontal hitbox 는 width × width 정사각형 강제라 +# 단일 entity 로는 "가로 0.375 × 두께 0.125" 직사각형 불가. → 두께(0.125) +# 와 같은 width=0.125 인 interaction 을 가로축으로 3 개 타일링 (gap 없이 +# 인접: 중심 0.375 / 0.5 / 0.625, 각 폭 0.125 → 합 [0.3125, 0.6875]). +# interaction Y 는 hitbox 바닥 → 소환 y = block y + 0.375, height = 0.25. +# +# ---- 깊이축: 블록 면 바로 바깥, 플레이어 쪽 (이중 트리거 방지) ---- +# interaction 박스가 stone_button hitbox 와 겹치면 한 번 클릭에 interaction +# 도 발화하고 stone_button 도 vanilla 클릭으로 인식되어 powered=true 애니 +# 메이션이 같이 일어남. → interaction 박스를 버튼 머리 바깥쪽 (플레이어 +# 측) 으로 한 두께 (0.125) 만큼 밀어 ray 가 stone_button 에 닿기 전에 +# interaction 에서 멈추게. +# +# 주의: facing 은 "버튼 머리 normal 방향" = 플레이어가 보는 방향. +# south 면 머리 +z 향함, 벽은 -z 쪽. 따라서 플레이어 쪽 = +z = interaction +# 을 z > 버튼 머리 (0.125) 영역으로. (v1.0.21 에서 한 두께만큼 뺀다는 +# 의도였는데 부호를 반대로 잡아 interaction 이 벽 안으로 들어가 있었음.) +# south : 깊이 z 중심 = 0.1875 (interaction z ∈ [0.125, 0.25], 버튼 z ∈ [0, 0.125]) +# north : 깊이 z 중심 = 0.8125 (interaction z ∈ [0.75, 0.875], 버튼 z ∈ [0.875, 1]) +# east : 깊이 x 중심 = 0.1875 +# west : 깊이 x 중심 = 0.8125 +# +# ---- positioned 의 .5 보정 회피 ---- +# MC 의 vec3 인자는 정수만 쓰면 자동으로 +0.5 보정됨 (블록 중심으로 잡힘). +# positioned 2773 86 5968 → 실제로는 (2773.5, 86, 5968.5). 거기서 ~ 오프셋 +# 을 더하면 박스 전체가 0.5 칸 어긋남. $(x).0 $(y).0 $(z).0 처럼 decimal +# 형태로 넘기면 보정 없이 정확한 블록 origin (minimal corner) 이 됨. +# +# ---- text_display 위치 (버튼 바로 아래 같은 벽면에 가운데 정렬) ---- +# 버튼 아래 블록의 같은 벽면 (visible 면, 플레이어 쪽) 에 살짝 띄워 부착. +# 가로축: ~0.5 (block 가로 중심, alignment=center 기본값과 합쳐져서 라벨 +# 자체도 수평 중앙). +# 세로축: text_display 의 entity Y 는 텍스트 윗변 — 아래로 자람. ~-0.25 +# 로 두면 텍스트 윗변이 Y-0.25 (버튼 바로 아래), 한 줄(기본 ~0.5 블록 높이) +# 이 Y-0.75 까지 내려와 버튼 아래 한 칸 벽면 [Y-1, Y] 의 위쪽 절반에 +# 자리잡음 — 시각적으로 버튼 바로 밑 가운데 라벨. +# south : ~0.5 ~-0.25 ~0.01 yaw 0 (head 가 +z → 벽면 z=0 에서 +0.01 띄움) +# north : ~0.5 ~-0.25 ~0.99 yaw 180 +# east : ~0.01 ~-0.25 ~0.5 yaw -90 +# west : ~0.99 ~-0.25 ~0.5 yaw 90 + +# ---- 비활성: 블록 + interaction × 3 + text_display 전부 제거 후 종료 ---- +# data modify entity @e[...] 는 대상 1개 강제 → interaction 3개 모드에선 +# 못 쓰므로 그냥 kill. 어차피 버튼 블록도 air 로 바꾸므로 라벨도 같이 제거. $execute if score $(n) buttons matches ..-2 run setblock $(x) $(y) $(z) minecraft:air -$execute if score $(n) buttons matches ..-2 run data modify entity @e[type=minecraft:interaction,tag=mq,tag=$(n),limit=1] response set value 0b +$execute if score $(n) buttons matches ..-2 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] +# $execute if score $(n) buttons matches ..-2 run kill @e[type=minecraft:text_display,tag=mq,tag=$(n)] $execute if score $(n) buttons matches ..-2 run return 0 + +# ---- 초기화: 블록 + interaction × 3 + text_display 보장 ---- $execute unless score $(n) buttons matches -1.. run scoreboard players set $(n) buttons -1 $execute if score $(n) buttons matches -1 run setblock $(x) $(y) $(z) minecraft:stone_button[face=wall,facing=$(f),powered=false] -$execute if score $(n) buttons matches -1 positioned $(x) $(y) $(z) run setblock ~ ~-3 ~ minecraft:redstone_block -$execute if score $(n) buttons matches -1 positioned $(x) $(y) $(z) run setblock ~ ~-3 ~ minecraft:red_wool +$execute if score $(n) buttons matches -1 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] +$execute if score $(n) buttons matches -1 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:text_display] + +# south: 깊이축=z(+0.1875, 플레이어 쪽), 가로축=x, 3 타일 + 라벨 +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.37 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.5 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.63 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.5 ~-0.5 ~0.01 {Tags:["mq","$(n)"],Rotation:[0f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}} + +# north: 깊이축=z(+0.8125, 플레이어 쪽), 가로축=x, 3 타일 + 라벨 +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.37 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.5 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.63 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.5 ~-0.5 ~0.99 {Tags:["mq","$(n)"],Rotation:[180f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}} + +# east: 깊이축=x(+0.1875, 플레이어 쪽), 가로축=z, 3 타일 + 라벨 +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.37 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.5 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.63 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.01 ~-0.5 ~0.5 {Tags:["mq","$(n)"],Rotation:[-90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}} + +# west: 깊이축=x(+0.8125, 플레이어 쪽), 가로축=z, 3 타일 + 라벨 +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.37 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.5 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.63 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b} +$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.99 ~-0.5 ~0.5 {Tags:["mq","$(n)"],Rotation:[90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}} + $execute if score $(n) buttons matches -1 run scoreboard players set $(n) buttons 0 -$execute if block $(x) $(y) $(z) minecraft:stone_button[face=wall,facing=$(f),powered=true] \ - if score $(n) buttons matches 0 \ - run scoreboard players set $(n) buttons 1 +# ---- 상시: interaction 클릭/타격 → playsound + 명령/투표 실행 ---- +# init main = 0 (퀴즈 시작 전 설정 단계) : 명령 직접 실행 +# 그 외 : trigger 투표 경로 +# 한 버튼에 interaction 3개지만 `on target` 은 클릭된 1개만 통과 +# (나머지는 target 부재로 체인 중단). limit=1 을 두면 MC 가 임의로 1개를 +# 골라 잘못된 entity 만 검사하므로 limit 두지 않음. +$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target as @s positioned $(x).0 $(y).0 $(z).0 run playsound minecraft:block.stone_button.click_on block @s ~ ~ ~ 1 1 +$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 0 run $(c) +$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target as @s positioned $(x).0 $(y).0 $(z).0 unless score init main matches 0 run trigger $(n) -$execute if score $(n) buttons matches 1 unless entity @e[type=minecraft:interaction,tag=mq,tag=$(n),limit=1] positioned $(x) $(y) $(z) run $(c) - -$execute if score $(n) buttons matches 1 \ - run scoreboard players set $(n) buttons 2 - -$execute if block $(x) $(y) $(z) minecraft:stone_button[face=wall,facing=$(f),powered=false] \ - if score $(n) buttons matches 1.. \ - run scoreboard players set $(n) buttons 0 - -$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n),limit=1] on target as @s positioned $(x) $(y) $(z) run playsound minecraft:block.stone_button.click_on block @s ~ ~ ~ 1 1 -$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n),limit=1] on target as @s positioned $(x) $(y) $(z) if score init main matches 0 run $(c) -$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n),limit=1] on target as @s positioned $(x) $(y) $(z) unless score init main matches 0 run trigger $(n) - -$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s attack -$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s interaction +# ---- 처리 후 attack/interaction NBT 클리어 (다음 tick 중복 발화 방지) ---- +$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] at @s run data remove entity @s attack +$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] at @s run data remove entity @s interaction diff --git a/music_quiz/data/mq/function/repeat/buttons/btn_prep.mcfunction b/music_quiz/data/mq/function/repeat/buttons/btn_prep.mcfunction new file mode 100644 index 0000000..3f9521c --- /dev/null +++ b/music_quiz/data/mq/function/repeat/buttons/btn_prep.mcfunction @@ -0,0 +1,21 @@ +# 한 button entry 의 optional 필드 기본값을 채워 macro 호출 시 $(arg) 미존재 +# 에러를 방지한다. handler 에서 entry 복사 직후 호출. +# +# label : 없으면 "" (빈 문자열) -> btn 안의 text_display 분기는 label +# 이 "" 이면 스킵. +# label_color : 기본 "black" +# label_font : 기본 "minecraft:default" +# label_scale : 기본 "1.0" (Vector3f 의 한 축, 3축 동일하게 사용됨) +# +# 구현: defaults 컴파운드를 먼저 만들고 entry (mq:tmp.btn) 를 그 위에 merge +# 한 뒤 다시 mq:tmp.btn 으로 되돌린다. data modify ... merge from 은 source +# compound 의 키로 target compound 를 덮어쓰므로 entry 에 있는 값은 보존되고 +# entry 에 없는 키만 default 값으로 채워진다. +# +# (이전에 `execute unless data storage mq:tmp btn.label run data modify ...` +# 방식이었으나 MC 26.1.2 parser 가 해당 라인을 거부했음. merge 방식은 문제 +# 난 execute-unless-data 구문 자체를 제거.) + +data modify storage mq:tmp btn_default set value {label:"",label_color:"black",label_font:"minecraft:default",label_scale:"1.0"} +data modify storage mq:tmp btn_default merge from storage mq:tmp btn +data modify storage mq:tmp btn set from storage mq:tmp btn_default diff --git a/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction b/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction index a3db64a..5c3e450 100644 --- a/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction +++ b/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction @@ -1,6 +1,27 @@ -function mq:repeat/buttons/btn with storage mq:main button_defs[0] -function mq:repeat/buttons/btn with storage mq:main button_defs[1] -function mq:repeat/buttons/btn with storage mq:main button_defs[2] -function mq:repeat/buttons/btn with storage mq:main button_defs[3] -function mq:repeat/buttons/btn with storage mq:main button_defs[4] -function mq:repeat/buttons/btn with storage mq:main button_defs[5] +# 각 button_defs 항목을 mq:tmp.btn 으로 복사 → optional 필드 기본값 채움 +# → btn 호출. btn 안에서 facing 별 분기 (if data storage mq:tmp btn{f:"..."}) +# 와 macro arg ($(label) 등) 둘 다 사용 가능하게 같은 storage 에 노출시킨다. + +data modify storage mq:tmp btn set from storage mq:main button_defs[0] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn + +data modify storage mq:tmp btn set from storage mq:main button_defs[1] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn + +data modify storage mq:tmp btn set from storage mq:main button_defs[2] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn + +data modify storage mq:tmp btn set from storage mq:main button_defs[3] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn + +data modify storage mq:tmp btn set from storage mq:main button_defs[4] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn + +data modify storage mq:tmp btn set from storage mq:main button_defs[5] +function mq:repeat/buttons/btn_prep +function mq:repeat/buttons/btn with storage mq:tmp btn diff --git a/music_quiz/data/mq/function/repeat/timer.mcfunction b/music_quiz/data/mq/function/repeat/timer.mcfunction index adbb1d1..0687447 100644 --- a/music_quiz/data/mq/function/repeat/timer.mcfunction +++ b/music_quiz/data/mq/function/repeat/timer.mcfunction @@ -6,44 +6,10 @@ execute unless score init main matches 2 \ run scoreboard players set timer main 0 # start title timer -execute if score init main matches 2 if score timer main matches 20 run title @a title {"text":"3"} -execute if score init main matches 2 if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 - -execute if score init main matches 2 if score timer main matches 40 run title @a title {"text":"2"} -execute if score init main matches 2 if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 - -execute if score init main matches 2 if score timer main matches 60 run title @a title {"text":"1"} -execute if score init main matches 2 if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 -execute if score init main matches 2 if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 - -execute if score init main matches 2 if score timer main matches 100 run title @a title {"text":""} -execute if score init main matches 2 if score timer main matches 100.. run function mq:quiz/select with storage mq:main +execute if score init main matches 2 run function mq:repeat/timers/init2 # next song timer -execute if score init main matches 6 if score timer main matches 300 run title @a title {"text":""} -execute if score init main matches 6 if score timer main matches 290 run function mq:images/clear -execute if score init main matches 6 if score timer main matches 300.. run function mq:quiz/select with storage mq:main +execute if score init main matches 6 run function mq:repeat/timers/init6 # endding timer -execute if score init main matches 10 if score timer main matches 60 run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"white","msg":""} -execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 - -execute if score init main matches 10 if score timer main matches 180 run function mq:tellraw {"text":"퀴즈를 다시 시작하시려면 종료를 눌러주세요.","color":"white","msg":""} -execute if score init main matches 10 if score timer main matches 120 as @a at @s run scoreboard players set stop buttons -1 -execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 - -execute if score init main matches 10 if score timer main matches 120 run function mq:tellraw {"text":"플레이 해주셔서 감사합니다.","color":"white","msg":""} -execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 -execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 - -execute if score init main matches 10 if score timer main matches 200.. run scoreboard players set init main 11 +execute if score init main matches 10 run function mq:repeat/timers/init10 diff --git a/music_quiz/data/mq/function/repeat/timers/init10.mcfunction b/music_quiz/data/mq/function/repeat/timers/init10.mcfunction new file mode 100644 index 0000000..eba4b9f --- /dev/null +++ b/music_quiz/data/mq/function/repeat/timers/init10.mcfunction @@ -0,0 +1,3 @@ +execute if score timer main matches 300 run title @a title {"text":""} +execute if score timer main matches 290 run function mq:images/clear +execute if score timer main matches 300.. run function mq:quiz/select with storage mq:main diff --git a/music_quiz/data/mq/function/repeat/timers/init2.mcfunction b/music_quiz/data/mq/function/repeat/timers/init2.mcfunction new file mode 100644 index 0000000..4c92604 --- /dev/null +++ b/music_quiz/data/mq/function/repeat/timers/init2.mcfunction @@ -0,0 +1,15 @@ +# warn-off-file execute-group +execute if score timer main matches 20 run title @a title {"text":"3"} +execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 40 run title @a title {"text":"2"} +execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 60 run title @a title {"text":"1"} +execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1 +execute if score timer main matches 100 run title @a title {"text":""} +execute if score timer main matches 100.. run function mq:quiz/select with storage mq:main diff --git a/music_quiz/data/mq/function/repeat/timers/init6.mcfunction b/music_quiz/data/mq/function/repeat/timers/init6.mcfunction new file mode 100644 index 0000000..4daccd5 --- /dev/null +++ b/music_quiz/data/mq/function/repeat/timers/init6.mcfunction @@ -0,0 +1,15 @@ +# warn-off-file execute-group +execute if score timer main matches 60 run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"white","msg":""} +execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 180 run function mq:tellraw {"text":"퀴즈를 다시 시작하시려면 종료를 눌러주세요.","color":"white","msg":""} +execute if score timer main matches 120 as @a at @s run scoreboard players set stop buttons -1 +execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 120 run function mq:tellraw {"text":"플레이 해주셔서 감사합니다.","color":"white","msg":""} +execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1 +execute if score timer main matches 200.. run scoreboard players set init main 11 diff --git a/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction b/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction index 1889239..b2dec6b 100644 --- a/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction +++ b/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction @@ -1,3 +1,4 @@ +# warn-off execute-group execute if score init main matches 0..1 run scoreboard players enable @a ready execute if score init main matches 0..1 as @a if score @s ready matches 1 run function mq:tellraw {"text":"","color":"black",msg:[{"selector":"@s","color": "yellow","bold": true},{"text":" : ","color":"gray"},{"text":"준비완료","color":"white"}]} execute if score init main matches 0..1 as @a if score @s ready matches 1 run scoreboard players set @s ready 2 diff --git a/music_quiz/data/mq/function/tick.mcfunction b/music_quiz/data/mq/function/tick.mcfunction index a796785..724d307 100644 --- a/music_quiz/data/mq/function/tick.mcfunction +++ b/music_quiz/data/mq/function/tick.mcfunction @@ -6,5 +6,6 @@ execute if score init main matches 2.. run function mq:repeat/timer execute if score init main matches 5..6 run function mq:repeat/check_answer # 정답 입력 다이얼로그: init=5 (곡 재생 중) 일 때만 열림 / 제출 처리 +# warn-off execute-group execute if score init main matches 5 as @a[scores={input=1..}] run function mq:answer/open execute if score init main matches 5 run function mq:answer/process diff --git a/music_quiz/data/mq/painting_variant/cover_01.json b/music_quiz/data/mq/painting_variant/cover_01.json index 046db53..15bea26 100644 --- a/music_quiz/data/mq/painting_variant/cover_01.json +++ b/music_quiz/data/mq/painting_variant/cover_01.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_01", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_01", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_02.json b/music_quiz/data/mq/painting_variant/cover_02.json index 83ac462..e7701d0 100644 --- a/music_quiz/data/mq/painting_variant/cover_02.json +++ b/music_quiz/data/mq/painting_variant/cover_02.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_02", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_02", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_03.json b/music_quiz/data/mq/painting_variant/cover_03.json index 5f8fafb..d26a803 100644 --- a/music_quiz/data/mq/painting_variant/cover_03.json +++ b/music_quiz/data/mq/painting_variant/cover_03.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_03", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_03", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_04.json b/music_quiz/data/mq/painting_variant/cover_04.json index 78670d7..8b26fa6 100644 --- a/music_quiz/data/mq/painting_variant/cover_04.json +++ b/music_quiz/data/mq/painting_variant/cover_04.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_04", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_04", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_05.json b/music_quiz/data/mq/painting_variant/cover_05.json index e2854e9..c04439f 100644 --- a/music_quiz/data/mq/painting_variant/cover_05.json +++ b/music_quiz/data/mq/painting_variant/cover_05.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_05", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_05", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_06.json b/music_quiz/data/mq/painting_variant/cover_06.json index c3a911d..d921c09 100644 --- a/music_quiz/data/mq/painting_variant/cover_06.json +++ b/music_quiz/data/mq/painting_variant/cover_06.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_06", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_06", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_07.json b/music_quiz/data/mq/painting_variant/cover_07.json index a0a7f16..9f3419b 100644 --- a/music_quiz/data/mq/painting_variant/cover_07.json +++ b/music_quiz/data/mq/painting_variant/cover_07.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_07", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_07", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_08.json b/music_quiz/data/mq/painting_variant/cover_08.json index bef5200..a788a99 100644 --- a/music_quiz/data/mq/painting_variant/cover_08.json +++ b/music_quiz/data/mq/painting_variant/cover_08.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_08", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_08", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_09.json b/music_quiz/data/mq/painting_variant/cover_09.json index b3c44ed..eaad9d1 100644 --- a/music_quiz/data/mq/painting_variant/cover_09.json +++ b/music_quiz/data/mq/painting_variant/cover_09.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_09", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_09", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_10.json b/music_quiz/data/mq/painting_variant/cover_10.json index eecccd9..f0f0ff6 100644 --- a/music_quiz/data/mq/painting_variant/cover_10.json +++ b/music_quiz/data/mq/painting_variant/cover_10.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_10", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_10", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_11.json b/music_quiz/data/mq/painting_variant/cover_11.json index 8bb173f..f46b9bf 100644 --- a/music_quiz/data/mq/painting_variant/cover_11.json +++ b/music_quiz/data/mq/painting_variant/cover_11.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_11", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_11", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_12.json b/music_quiz/data/mq/painting_variant/cover_12.json index e05d1fe..a09694a 100644 --- a/music_quiz/data/mq/painting_variant/cover_12.json +++ b/music_quiz/data/mq/painting_variant/cover_12.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_12", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_12", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_13.json b/music_quiz/data/mq/painting_variant/cover_13.json index 3bc50f4..04d377b 100644 --- a/music_quiz/data/mq/painting_variant/cover_13.json +++ b/music_quiz/data/mq/painting_variant/cover_13.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_13", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_13", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_14.json b/music_quiz/data/mq/painting_variant/cover_14.json index dc00743..79c3468 100644 --- a/music_quiz/data/mq/painting_variant/cover_14.json +++ b/music_quiz/data/mq/painting_variant/cover_14.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_14", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_14", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_15.json b/music_quiz/data/mq/painting_variant/cover_15.json index 82779b8..0ba314a 100644 --- a/music_quiz/data/mq/painting_variant/cover_15.json +++ b/music_quiz/data/mq/painting_variant/cover_15.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_15", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_15", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_16.json b/music_quiz/data/mq/painting_variant/cover_16.json index c0097b4..4a784bd 100644 --- a/music_quiz/data/mq/painting_variant/cover_16.json +++ b/music_quiz/data/mq/painting_variant/cover_16.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_16", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_16", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_17.json b/music_quiz/data/mq/painting_variant/cover_17.json index 6cad7e2..e7a50c4 100644 --- a/music_quiz/data/mq/painting_variant/cover_17.json +++ b/music_quiz/data/mq/painting_variant/cover_17.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:cover_17", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "cover_17", + "author": "musicquiz" } diff --git a/music_quiz/data/mq/painting_variant/cover_18.json b/music_quiz/data/mq/painting_variant/cover_18.json deleted file mode 100644 index 81c16ce..0000000 --- a/music_quiz/data/mq/painting_variant/cover_18.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_18", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_19.json b/music_quiz/data/mq/painting_variant/cover_19.json deleted file mode 100644 index de0bb93..0000000 --- a/music_quiz/data/mq/painting_variant/cover_19.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_19", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_20.json b/music_quiz/data/mq/painting_variant/cover_20.json deleted file mode 100644 index fc33242..0000000 --- a/music_quiz/data/mq/painting_variant/cover_20.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_20", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_21.json b/music_quiz/data/mq/painting_variant/cover_21.json deleted file mode 100644 index 2836a22..0000000 --- a/music_quiz/data/mq/painting_variant/cover_21.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_21", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_22.json b/music_quiz/data/mq/painting_variant/cover_22.json deleted file mode 100644 index 2485aa7..0000000 --- a/music_quiz/data/mq/painting_variant/cover_22.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_22", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_23.json b/music_quiz/data/mq/painting_variant/cover_23.json deleted file mode 100644 index a88f8a6..0000000 --- a/music_quiz/data/mq/painting_variant/cover_23.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_23", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_24.json b/music_quiz/data/mq/painting_variant/cover_24.json deleted file mode 100644 index fa9b490..0000000 --- a/music_quiz/data/mq/painting_variant/cover_24.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_24", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_25.json b/music_quiz/data/mq/painting_variant/cover_25.json deleted file mode 100644 index 6b96d8e..0000000 --- a/music_quiz/data/mq/painting_variant/cover_25.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_25", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_26.json b/music_quiz/data/mq/painting_variant/cover_26.json deleted file mode 100644 index 1f5c5dd..0000000 --- a/music_quiz/data/mq/painting_variant/cover_26.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_26", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_27.json b/music_quiz/data/mq/painting_variant/cover_27.json deleted file mode 100644 index fdb4781..0000000 --- a/music_quiz/data/mq/painting_variant/cover_27.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_27", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_28.json b/music_quiz/data/mq/painting_variant/cover_28.json deleted file mode 100644 index 5179090..0000000 --- a/music_quiz/data/mq/painting_variant/cover_28.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_28", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_29.json b/music_quiz/data/mq/painting_variant/cover_29.json deleted file mode 100644 index 52ead53..0000000 --- a/music_quiz/data/mq/painting_variant/cover_29.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_29", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_30.json b/music_quiz/data/mq/painting_variant/cover_30.json deleted file mode 100644 index edec2cc..0000000 --- a/music_quiz/data/mq/painting_variant/cover_30.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_30", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_31.json b/music_quiz/data/mq/painting_variant/cover_31.json deleted file mode 100644 index f743eea..0000000 --- a/music_quiz/data/mq/painting_variant/cover_31.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_31", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_32.json b/music_quiz/data/mq/painting_variant/cover_32.json deleted file mode 100644 index 07857f4..0000000 --- a/music_quiz/data/mq/painting_variant/cover_32.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_32", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_33.json b/music_quiz/data/mq/painting_variant/cover_33.json deleted file mode 100644 index 1ae4165..0000000 --- a/music_quiz/data/mq/painting_variant/cover_33.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_33", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_34.json b/music_quiz/data/mq/painting_variant/cover_34.json deleted file mode 100644 index 7ad2476..0000000 --- a/music_quiz/data/mq/painting_variant/cover_34.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_34", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_35.json b/music_quiz/data/mq/painting_variant/cover_35.json deleted file mode 100644 index cd75677..0000000 --- a/music_quiz/data/mq/painting_variant/cover_35.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_35", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_36.json b/music_quiz/data/mq/painting_variant/cover_36.json deleted file mode 100644 index b404331..0000000 --- a/music_quiz/data/mq/painting_variant/cover_36.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_36", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_37.json b/music_quiz/data/mq/painting_variant/cover_37.json deleted file mode 100644 index 5473447..0000000 --- a/music_quiz/data/mq/painting_variant/cover_37.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_37", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_38.json b/music_quiz/data/mq/painting_variant/cover_38.json deleted file mode 100644 index 8efee00..0000000 --- a/music_quiz/data/mq/painting_variant/cover_38.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_38", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_39.json b/music_quiz/data/mq/painting_variant/cover_39.json deleted file mode 100644 index c1180eb..0000000 --- a/music_quiz/data/mq/painting_variant/cover_39.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_39", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_40.json b/music_quiz/data/mq/painting_variant/cover_40.json deleted file mode 100644 index 2f615dd..0000000 --- a/music_quiz/data/mq/painting_variant/cover_40.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_40", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_41.json b/music_quiz/data/mq/painting_variant/cover_41.json deleted file mode 100644 index 1d4c17c..0000000 --- a/music_quiz/data/mq/painting_variant/cover_41.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_41", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_42.json b/music_quiz/data/mq/painting_variant/cover_42.json deleted file mode 100644 index 9cfc55d..0000000 --- a/music_quiz/data/mq/painting_variant/cover_42.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_42", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_43.json b/music_quiz/data/mq/painting_variant/cover_43.json deleted file mode 100644 index 3dd1fac..0000000 --- a/music_quiz/data/mq/painting_variant/cover_43.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_43", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_44.json b/music_quiz/data/mq/painting_variant/cover_44.json deleted file mode 100644 index e2f7928..0000000 --- a/music_quiz/data/mq/painting_variant/cover_44.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_44", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_45.json b/music_quiz/data/mq/painting_variant/cover_45.json deleted file mode 100644 index d3be956..0000000 --- a/music_quiz/data/mq/painting_variant/cover_45.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_45", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_46.json b/music_quiz/data/mq/painting_variant/cover_46.json deleted file mode 100644 index 32adb1a..0000000 --- a/music_quiz/data/mq/painting_variant/cover_46.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_46", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_47.json b/music_quiz/data/mq/painting_variant/cover_47.json deleted file mode 100644 index a3fc253..0000000 --- a/music_quiz/data/mq/painting_variant/cover_47.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_47", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_48.json b/music_quiz/data/mq/painting_variant/cover_48.json deleted file mode 100644 index bad13de..0000000 --- a/music_quiz/data/mq/painting_variant/cover_48.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_48", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_49.json b/music_quiz/data/mq/painting_variant/cover_49.json deleted file mode 100644 index 7c6a7b2..0000000 --- a/music_quiz/data/mq/painting_variant/cover_49.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_49", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/cover_50.json b/music_quiz/data/mq/painting_variant/cover_50.json deleted file mode 100644 index ee03522..0000000 --- a/music_quiz/data/mq/painting_variant/cover_50.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asset_id": "musicquiz:cover_50", - "width": 1, - "height": 1 -} diff --git a/music_quiz/data/mq/painting_variant/gif.json b/music_quiz/data/mq/painting_variant/gif.json index 398cbb0..4c895d1 100644 --- a/music_quiz/data/mq/painting_variant/gif.json +++ b/music_quiz/data/mq/painting_variant/gif.json @@ -1,5 +1,7 @@ { "asset_id": "musicquiz:gif", - "width": 1, - "height": 1 + "width": 2, + "height": 2, + "title": "gif", + "author": "musicquiz" } diff --git a/music_quiz/pack.mcmeta b/music_quiz/pack.mcmeta index ac160d4..5ce8ec7 100644 --- a/music_quiz/pack.mcmeta +++ b/music_quiz/pack.mcmeta @@ -1,8 +1,7 @@ { "pack": { - "pack_format": 75, - "min_format": 75, - "max_format": 75, - "description": "음악퀴즈용 데이터팩입니다." + "description": "음악퀴즈용 데이터팩입니다.", + "min_format": [101, 1], + "max_format": [101, 1] } }