4 Commits

Author SHA1 Message Date
Claude (owner)
416eaee14a music_quiz: chat_answer 모드 활성 알림 — race-free 함수 호출 방식으로 전환
기존: storage chat_answer:status active 1b/0b 플래그를 모드가 set,
데이터팩이 mq:load 에서 0b 로 reset 하는 구조였는데,
통합 서버에서 mq:load 가 player join 이후에 도는 케이스가 발견되어
모드가 써놓은 1b 를 데이터팩이 직후에 0b 로 덮어쓰는 race 발생.

수정: storage 플래그를 완전히 제거. 모드가 직접 PlayerLoggedInEvent
핸들러에서 mq:players/mod_active_notice 함수를 해당 플레이어로 호출.
데이터팩이 없으면 함수가 없어 silent fail → race 없음.

- mq:load: chat_answer:status 0b 초기화 라인 삭제
- mq:players/login: 조건부 tellraw 제거 (모드가 직접 호출하므로)
- mq:players/mod_active_notice: 새 함수, 그냥 tellraw 만 수행
2026-05-14 03:14:55 +09:00
Claude (owner)
de6e040623 music_quiz: add pack.png icon 2026-05-14 02:28:52 +09:00
Claude (owner)
141bc5eaa5 music_quiz: fix invalid dialog type — simple_input_form → notice
mq/dialog/answer.json 이 'minecraft:simple_input_form' 타입을 쓰는데
1.21.6 dialog registry 에 그 타입이 없어서 데이터팩 로드 자체가 실패
"세계를 불러올 수 없습니다" 오류. 유효한 타입 중 단일 버튼 + inputs 를
지원하는 minecraft:notice 로 교체, action 을 button(label+inner action)
구조로 감싼다. dynamic/run_command 템플릿은 그대로 — $(text) 매크로 치환.
2026-05-13 23:36:29 +09:00
Claude (owner)
083297bf50 music_quiz: songs 의 volume 을 필수 기본 정보로 승격 (전 곡 기본 1.0)
기존엔 volume 이 선택 필드여서 미지정 시 config.audio.volume 으로 fallback 되었는데,
곡마다 음량 조절을 자주 하기 위해 모든 곡 엔트리에 volume 을 명시 (모두 1.0). 런타임
quiz/play_sound 흐름은 그대로 — songs[i].volume 을 그대로 사용.
2026-05-13 22:27:17 +09:00
6 changed files with 66 additions and 63 deletions

View File

@@ -1,9 +1,10 @@
{
"type": "minecraft:simple_input_form",
"type": "minecraft:notice",
"title": {
"text": "정답 입력",
"bold": true
},
"body": [],
"inputs": [
{
"type": "minecraft:text",
@@ -20,7 +21,12 @@
"pause": false,
"after_action": "close",
"action": {
"type": "minecraft:dynamic/run_command",
"template": "function mq:answer/submit {text:'$(text)'}"
"label": {
"text": "제출"
},
"action": {
"type": "minecraft:dynamic/run_command",
"template": "function mq:answer/submit {text:'$(text)'}"
}
}
}

View File

@@ -1,60 +1,59 @@
# 곡 한 개 = 한 줄.
# 필수 — title, author, alias
# 선택 — volume (이 곡만의 /playsound 음량. 미지정시 init/config.mcfunction
# 의 audio.volume 사용)
# 필수 — title, author, alias, volume
# volume: /playsound 음량. 1.0 = 기본. 곡마다 음량 조절 가능.
# 곡 순서가 리소스팩의 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:[" "," "," "]}
data modify storage mq:main songs append value {title:"The Chase", author:"Hearts2Hearts", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"HOT SAUCE", author:"BABYMONSTER", alias:[" "," "]}
data modify storage mq:main songs append value {title:"Golden", author:"HUNTR/X", alias:[""," "]}
data modify storage mq:main songs append value {title:"돌림판", author:"머쉬베놈", alias:["Spin the wheel"]}
data modify storage mq:main songs append value {title:"OVERDRIVE", author:"TWS", alias:["",""]}
data modify storage mq:main songs append value {title:"눈물참기", author:"QWER", alias:[]}
data modify storage mq:main songs append value {title:"깨어", author:"tripleS", alias:[]}
data modify storage mq:main songs append value {title:"like JENNIE", author:"제니", alias:[" "," "," "," "]}
data modify storage mq:main songs append value {title:"Rich Man", author:"aespa", alias:[" "," "]}
data modify storage mq:main songs append value {title:"I DO ME", author:"KiiiKiii", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"SIGN", author:"izna", alias:["",""]}
data modify storage mq:main songs append value {title:"WICKED", author:"ALLDAY PROJECT", alias:["",""]}
data modify storage mq:main songs append value {title:"Good Thing", author:"i-dle", alias:["굿 "," "," "]}
data modify storage mq:main songs append value {title:"0+0", author:"한로로", alias:[]}
data modify storage mq:main songs append value {title:"HANDS UP", author:"MEOVV", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"Blue Valentine", author:"NMIXX", alias:[" "," "]}
data modify storage mq:main songs append value {title:"Flower", author:"오반", alias:["",""]}
data modify storage mq:main songs append value {title:"Soda Pop", author:"Saja Boys", alias:[" "," "]}
data modify storage mq:main songs append value {title:"REBEL HEART", author:"IVE", alias:[" "," "]}
data modify storage mq:main songs append value {title:"GO!", author:"CORTIS", alias:["","!","GO","","!"]}
data modify storage mq:main songs append value {title:"BEEP", author:"izna", alias:["","",""]}
data modify storage mq:main songs append value {title:"Pookie", author:"FIFTY FIFTY", alias:["",""]}
data modify storage mq:main songs append value {title:"DAISIES", author:"Justin Bieber", alias:["","",""]}
data modify storage mq:main songs append value {title:"빌려온 고양이", author:"ILLIT", alias:[]}
data modify storage mq:main songs append value {title:"TOO BAD", author:"OfficialGDRAGON", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"시작의 아이", author:"마크툽", alias:[]}
data modify storage mq:main songs append value {title:"STYLE", author:"Hearts2Hearts", alias:["",""]}
data modify storage mq:main songs append value {title:"Good Goodbye", author:"화사", alias:["굿 굿"," "," "]}
data modify storage mq:main songs append value {title:"너에게 닿기를", author:"10CM", alias:[]}
data modify storage mq:main songs append value {title:"IRIS OUT", author:"Kenshi Yonezu", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"Sugar On My Tongue", author:"Tyler, The Creator", alias:[" "," "," "]}
data modify storage mq:main songs append value {title:"Hollywood Action", author:"BOYNEXTDOOR", alias:[" "," "]}
data modify storage mq:main songs append value {title:"SPAGHETTI", author:"LE SSERAFIM", alias:["",""]}
data modify storage mq:main songs append value {title:"Gabriela", author:"KATSEYE", alias:["",""]}
data modify storage mq:main songs append value {title:"LIKE YOU BETTER", author:"프로미스나인", alias:[" "," "," "," "," "]}
data modify storage mq:main songs append value {title:"뛰어", author:"BLACKPINK", alias:["jump"]}
data modify storage mq:main songs append value {title:"CHANEL", author:"Tyla", alias:["",""]}
data modify storage mq:main songs append value {title:"오늘만 I LOVE YOU", author:"BOYNEXTDOOR", alias:[" "," "]}
data modify storage mq:main songs append value {title:"earthquake", author:"지수", alias:["","",""," "]}
data modify storage mq:main songs append value {title:"윽!", author:"염따", alias:[""]}
data modify storage mq:main songs append value {title:"Abracadabra", author:"Lady Gaga", alias:["",""]}
data modify storage mq:main songs append value {title:"멸종위기사랑", author:"이찬혁", alias:[]}
data modify storage mq:main songs append value {title:"Dirty Work", author:"aespa", alias:[" "," "," "," "," "]}
data modify storage mq:main songs append value {title:"HOT", author:"LE SSERAFIM", alias:["",""]}
data modify storage mq:main songs append value {title:"FAMOUS", author:"ALLDAY PROJECT", alias:["",""]}
data modify storage mq:main songs append value {title:"XOXZ", author:"IVE", alias:[" "," ",""]}
data modify storage mq:main songs append value {title:"여름이었다", author:"H1-KEY", alias:[]}
data modify storage mq:main songs append value {title:"LOV3", author:"식케이", alias:["3","3"]}
data modify storage mq:main songs append value {title:"Drive", author:"Ed Sheeran", alias:["",""]}
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}
# 곡 개수는 songs 배열 길이에서 자동 계산됨
execute store result storage mq:main max_index int 1 run data get storage mq:main songs

View File

@@ -2,10 +2,6 @@ data modify storage mq:main answer set value {title:"", author:"", alias:[]}
data merge storage func:temp {}
data merge storage mq:tmp {}
# chat_answer 모드 활성화 플래그 초기화. 모드가 살아있으면 첫 플레이어 로그인 직후
# 모드가 다시 1b 로 set 함. 모드가 빠지면 이대로 0b 유지 → 로그인 메세지 미표시.
data modify storage chat_answer:status active set value 0b
function mq:init/config
function mq:init/songs
function mq:init/buttons

View File

@@ -9,6 +9,5 @@ $setworldspawn $(x) $(y) $(z) $(r) $(f)
$tp @s $(x) $(y) $(z) $(r) $(f)
gamemode adventure @s
# chat_answer 모드가 살아있으면 PlayerLoggedInEvent 핸들러가 active=1b 로 set.
# mq:load 에서 0b 로 초기화되어 있으므로, 1b 인 상황 = 모드 활성.
execute if data storage chat_answer:status {active:1b} run tellraw @s ["",{"text":"[채팅정답] ","color":"green","bold":true},{"text":"모드가 활성화되어 있습니다.","color":"gray"},{"text":" 정답 입력 시 ","color":"gray"},{"text":"채팅","color":"yellow","bold":true},{"text":"으로 바로 제출할 수 있습니다.","color":"gray"}]
# 채팅정답 모드 활성 알림은 모드가 직접 PlayerLoggedInEvent 핸들러에서
# mq:players/mod_active_notice 를 호출해서 표시한다 (race-free).

View File

@@ -0,0 +1,3 @@
# chat_answer 모드의 PlayerLoggedInEvent 핸들러가 직접 호출.
# 모드가 없으면 이 함수가 호출될 일이 없으므로 메세지가 안 뜬다.
tellraw @s ["",{"text":"[채팅정답] ","color":"green","bold":true},{"text":"모드가 활성화되어 있습니다.","color":"gray"},{"text":" 정답 입력 시 ","color":"gray"},{"text":"채팅","color":"yellow","bold":true},{"text":"으로 바로 제출할 수 있습니다.","color":"gray"}]

BIN
music_quiz/pack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB