buttons: 종료 상태(init 10/11)에서 정지 버튼이 먹지 않던 버그 수정

퀴즈 종료 후(quiz/end → init=10, init10 타이머의 "종료를 눌러주세요" 안내)
정지 버튼을 눌러도 종료/재시작이 안 됐다. 정지 버튼 클릭은 init!=0 이면 투표
경로(trigger stop)로 가는데, 투표 집계(repeat/triggers/trigger)는 init==5 에서만
수행돼 종료 상태에서는 무시됐기 때문.

종료 상태는 단일 클릭 재시작이 의도이므로(init==0 설정단계와 동일), init>=10 에서
정지 버튼을 투표 없이 commands/stop 으로 직접 실행하도록 분기 추가. commands/stop 이
init 을 0 으로 만들어 같은 tick 의 투표 줄은 자동으로 건너뛴다(중복 실행 없음).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Claude (owner)
2026-06-14 02:15:41 +09:00
parent c85bc58039
commit e7a84dc4ae

View File

@@ -104,6 +104,7 @@ $execute if score $(n) buttons matches -1 run scoreboard players set $(n) button
# ---- 상시: interaction 클릭/타격 → playsound + 명령/투표 실행 ----
# init main = 0 (퀴즈 시작 전 설정 단계) : 명령 직접 실행
# init main >= 10 (종료 상태) + 정지 버튼 : 명령 직접 실행 (재시작용, 투표 없음)
# 그 외 : trigger 투표 경로
# 한 버튼에 interaction 3개지만 `on target` 은 클릭된 1개만 통과
# (나머지는 target 부재로 체인 중단). limit=1 을 두면 MC 가 임의로 1개를
@@ -111,6 +112,11 @@ $execute if score $(n) buttons matches -1 run scoreboard players set $(n) button
$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 if data storage mq:tmp btn{n:"test"} run $(c)
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target unless data storage mq:tmp btn{n:"test"} as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 0 run $(c)
# 종료 상태(init 10/11)에서 정지 버튼 단일 클릭 → 즉시 commands/stop 으로 재시작 대기(init 0).
# 투표 집계는 repeat/triggers/trigger 가 init==5 에서만 하므로, 이 분기 없이는 종료 안내문
# ("종료를 눌러주세요")대로 눌러도 종료가 안 된다. commands/stop 이 init 을 0 으로 만들어
# 아래 투표 줄(unless init==0)은 같은 tick 에 자동으로 건너뛰어진다(중복 실행 없음).
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target if data storage mq:tmp btn{n:"stop"} as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 10.. run $(c)
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target unless data storage mq:tmp btn{n:"test"} as @s positioned $(x).0 $(y).0 $(z).0 unless score init main matches 0 run trigger $(n)
# ---- 처리 후 attack/interaction NBT 클리어 (다음 tick 중복 발화 방지) ----