nbt 소스 텍스트 컴포넌트는 1.21.5+ 에서 문자열을 SNBT(초록 따옴표, color 무시)로 렌더해 액션바에 "url" 형태로 초록색으로 나왔다. macro(mq:videos/actionbar)로 URL 을 리터럴 text 에 넣어 흰색 평문으로 출력한다. video 가 있으면(빈 "" 포함) macro, 없으면 빈 actionbar 로 덮어써 always-output·잔상 방지 동작은 유지. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
16 lines
1.2 KiB
MCFunction
16 lines
1.2 KiB
MCFunction
# 정답 공개 동안(init=6) 곡 video URL 을 actionbar 에 흰색 평문으로 계속 표시.
|
|
# nbt 소스 컴포넌트는 이 버전에서 문자열을 SNBT(초록 따옴표, color 무시)로 렌더하므로
|
|
# macro(mq:videos/actionbar)로 URL 을 리터럴 text 에 넣어 흰색 평문으로 출력한다.
|
|
# video 가 있으면(빈 "" 포함) macro 호출, 없으면 빈 actionbar 로 덮어써 잔상 방지.
|
|
execute if data storage mq:main answer.video run function mq:videos/actionbar with storage mq:main answer
|
|
execute unless data storage mq:main answer.video run title @a actionbar {"text":""}
|
|
|
|
execute if score timer main matches 300 run title @a title {"text":""}
|
|
# 다음 상태로 넘어가기 전 actionbar 비우기 — 안 비우면 마지막 URL 이 다음 곡(init=5)
|
|
# 초반까지 ~3초 잔상으로 남는다. select 보다 먼저 실행되어 깔끔히 지워진다.
|
|
execute if score timer main matches 300 run title @a actionbar {"text":""}
|
|
# warn-off execute-group
|
|
execute if score timer main matches 290 run function mq:images/clear
|
|
execute if score timer main matches 290 run function mq:videos/clear
|
|
execute if score timer main matches 300.. run function mq:quiz/select with storage mq:main
|