Files
mc_datapack/music_quiz/data/mq/function/load.mcfunction
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

30 lines
1.0 KiB
MCFunction

data modify storage mq:main answer set value {title:"", author:"", alias:[]}
data merge storage func:temp {}
data merge storage mq:tmp {}
function mq:init/config
function mq:init/songs
function mq:init/buttons
function mq:init/triggers
function mq:tellraw {"text":"서버 리로드 성공!","color":"white","msg":'""'}
scoreboard objectives remove func.temp
scoreboard objectives remove main
scoreboard objectives remove buttons
scoreboard objectives remove answer
scoreboard objectives remove leave_game
scoreboard objectives add func.temp dummy
scoreboard objectives add main dummy
scoreboard objectives add buttons dummy
scoreboard objectives add answer dummy
scoreboard objectives add leave_game custom:leave_game
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}]
function mq:commands/stop with storage mq:main
function mq:players/login with storage mq:main spawn