From e7a84dc4ae796b60e981a8c0c260b37cf884d78e Mon Sep 17 00:00:00 2001 From: "Claude (owner)" Date: Sun, 14 Jun 2026 02:15:41 +0900 Subject: [PATCH] =?UTF-8?q?buttons:=20=EC=A2=85=EB=A3=8C=20=EC=83=81?= =?UTF-8?q?=ED=83=9C(init=2010/11)=EC=97=90=EC=84=9C=20=EC=A0=95=EC=A7=80?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=EC=9D=B4=20=EB=A8=B9=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8D=98=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 퀴즈 종료 후(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 --- music_quiz/data/mq/function/repeat/buttons/btn.mcfunction | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction b/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction index 2e6d666..055894d 100644 --- a/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction +++ b/music_quiz/data/mq/function/repeat/buttons/btn.mcfunction @@ -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 중복 발화 방지) ----