mq:load 가 storage chat_answer:status active 를 0b 로 초기화. chat_answer 모드의 PlayerLoggedInEvent / ServerPlayConnectionEvents.JOIN 핸들러가 첫 로그인 직후 1b 로 set 하므로, mq:players/login 에서 1b 인 경우 "[채팅정답] 모드가 활성화되어 있습니다. 정답 입력 시 채팅으로 바로 제출할 수 있습니다." tellraw.
34 lines
1.3 KiB
MCFunction
34 lines
1.3 KiB
MCFunction
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
|
|
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
|