v1.0.26: 삭제됐던 docs/temp 복구 + README 사실 정정
리뷰어 지적 후속:
- docs/mc_video_player_mod_integration.md 복구 (f0a2e4f 에서 추출).
pull 시점에 main 에 없어서 같이 사라졌던 파일.
- temp/ 부분 적용 패키지 v1.0.26 기준으로 복구. 좌표 보존을 위해
init/*.mcfunction 은 일부러 제외, framework 파일만 포함:
- commands/start.mcfunction, load.mcfunction (모드 게이트 + objective)
- repeat/buttons/{btn,btn_prep,handler}.mcfunction
- repeat/timer.mcfunction + repeat/timers/{init2,init6,init10}.mcfunction
- temp/README.md 에 적용 방법 + 라벨 추가 안내 명시.
- README.md 사실 정정:
- 음원 채널 "기본 weather" → 실제 config.mcfunction 은 player
(UI 비프만 weather). source 가 무엇이 무엇인지 명시.
- 스토리지 섹션의 marker 항목 제거 (현재 config 에 marker 정의 없음,
legacy kill 한 줄만 잔존). mq:input 큐 추가, mq:tmp 페이로드 갱신.
- init/config.mcfunction 설명 / 좌표 의존성 섹션에서 marker 제거.
데이터팩 코드 변경 없음 — v1.0.25 = v1.0.26 동작 동일.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
111
temp/README.md
Normal file
111
temp/README.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# 부분 적용 가이드 (→ v1.0.26)
|
||||
|
||||
전체 datapack zip 을 새로 풀지 않고, 이 폴더의 파일만 같은 경로에
|
||||
덮어쓰면 v1.0.26 와 동일한 동작이 됩니다. 본인 월드 좌표·곡 목록 등이
|
||||
들어 있는 `init/*.mcfunction` 은 일부러 포함하지 않았습니다 — 덮어쓰면
|
||||
좌표가 날아가니까요.
|
||||
|
||||
## v1.0.26 = v1.0.25 + 문서 정리
|
||||
|
||||
v1.0.26 자체에는 데이터팩 동작 변경이 없습니다. 변경 사항:
|
||||
- 삭제됐던 `docs/mc_video_player_mod_integration.md` 복구.
|
||||
- 루트 `README.md` 의 오류 정정:
|
||||
- 음원 채널 `weather` → 실제는 `player` (UI 비프만 `weather`) 로 정정.
|
||||
- 폐기된 `marker` 스토리지/엔티티 설명을 “legacy 정리용” 으로 정리.
|
||||
- `temp/` 부분 적용 패키지 v1.0.26 기준으로 복구 (이 폴더).
|
||||
|
||||
v1.0.25 의 데이터팩 코드를 이미 쓰고 있다면 mods · 데이터팩 변경 없이
|
||||
끝납니다. **이 폴더를 적용해야 하는 건 v1.0.25 이전 버전에서 올라오는
|
||||
경우** 입니다.
|
||||
|
||||
## 같이 들어 있는 누적 fix (v1.0.19 ~ v1.0.25)
|
||||
|
||||
### 버튼 인프라 (`repeat/buttons/`)
|
||||
- `btn.mcfunction` / `btn_prep.mcfunction` / `handler.mcfunction`
|
||||
- v1.0.20: `positioned $(x).0 $(y).0 $(z).0` (정수 vec3 의 자동 +0.5 보정
|
||||
회피), `btn_prep` 의 `merge from` defaults 패턴 (`execute unless data
|
||||
storage ...` 파서 거부 회피).
|
||||
- v1.0.21: interaction 3 타일 분할 (`width × width` 정사각형 강제 회피),
|
||||
`text_display` 도입, text component 직접 표기 (1.20.5+ JSON string
|
||||
렌더 회피).
|
||||
- v1.0.24: interaction 깊이 부호 정정 (벽 안 → 플레이어 쪽), `text_display`
|
||||
Y 위치 보정, 라벨 bold.
|
||||
- v1.0.25: hitbox 미세조정 (가운데 타일 폭 0.13, height 0.26, 깊이
|
||||
0.07/0.93, text_display Y `~-0.5`), 셀렉터 정렬 통일.
|
||||
|
||||
### 모드 게이트 (`commands/start.mcfunction` + `load.mcfunction`)
|
||||
- v1.0.23 / v1.0.25: `#server mq_chat_mod` 점수로 `mc_chat_answer_mod`
|
||||
설치 검증, `#server mq_video_mod` + `<player> mq_video_mod` 점수로
|
||||
`mc_video_player_mod` 서버/클라 설치 검증. 미설치 시 사유와 함께 차단.
|
||||
- `load.mcfunction` 이 objective 생성 + `#server` 0 materialize.
|
||||
|
||||
### 타이머 분할 (`repeat/timer.mcfunction` + `repeat/timers/`)
|
||||
- v1.0.25: 큰 `timer.mcfunction` 을 init 단계별 (`init2` 카운트다운,
|
||||
`init6` 다음 곡, `init10` 엔딩) 서브함수로 분할. `timer.mcfunction` 은
|
||||
init 게이팅만 하고 각 서브를 호출.
|
||||
|
||||
## 적용 방법
|
||||
|
||||
### 1. 모드 jar 확인 (이미 설치돼 있으면 skip)
|
||||
|
||||
- `mc_chat_answer_mod` v1.3.7+ : 서버 mods 폴더.
|
||||
https://git.tkrmagid.kr/tkrmagid/mc_chat_answer_mod/releases/tag/v1.3.7
|
||||
- `mc_video_player_mod` : 서버 mods + 클라이언트 mods 양쪽 설치 필요.
|
||||
|
||||
### 2. 데이터팩 파일 덮어쓰기
|
||||
|
||||
서버의 datapack 폴더 (예: `world/datapacks/music_quiz/`) 기준으로 이 폴더
|
||||
아래 파일을 **같은 경로에 덮어쓰세요**.
|
||||
|
||||
```
|
||||
temp/data/mq/function/commands/start.mcfunction
|
||||
-> <datapack>/data/mq/function/commands/start.mcfunction
|
||||
|
||||
temp/data/mq/function/load.mcfunction
|
||||
-> <datapack>/data/mq/function/load.mcfunction
|
||||
|
||||
temp/data/mq/function/repeat/buttons/btn.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/buttons/btn.mcfunction
|
||||
temp/data/mq/function/repeat/buttons/btn_prep.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/buttons/btn_prep.mcfunction
|
||||
temp/data/mq/function/repeat/buttons/handler.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/buttons/handler.mcfunction
|
||||
|
||||
temp/data/mq/function/repeat/timer.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/timer.mcfunction
|
||||
temp/data/mq/function/repeat/timers/init2.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/timers/init2.mcfunction
|
||||
temp/data/mq/function/repeat/timers/init6.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/timers/init6.mcfunction
|
||||
temp/data/mq/function/repeat/timers/init10.mcfunction
|
||||
-> <datapack>/data/mq/function/repeat/timers/init10.mcfunction
|
||||
```
|
||||
|
||||
`repeat/timers/` 폴더는 없을 수도 있습니다 — 그 경우 새로 생성하고 안에
|
||||
파일 3 개를 넣으세요.
|
||||
|
||||
### 3. (옵션) 버튼에 라벨 표시하고 싶으면 `init/buttons.mcfunction` 편집
|
||||
|
||||
좌표를 건들지 않기 위해 `init/buttons.mcfunction` 은 포함하지 않았습니다.
|
||||
직접 편집해서 각 `button_defs` 항목에 `label` 필드를 추가하면 됩니다.
|
||||
옵션 필드는 `label`, `label_color` (기본 `black`), `label_font` (기본
|
||||
`minecraft:default`), `label_scale` (기본 `"1.0"`).
|
||||
|
||||
```
|
||||
data modify storage mq:main button_defs append value {n:"start", x:..., y:..., z:..., f:"south", c:"function mq:commands/start with storage mq:main", label:"게임시작"}
|
||||
```
|
||||
|
||||
### 4. /reload
|
||||
|
||||
```
|
||||
/reload
|
||||
```
|
||||
|
||||
## 확인
|
||||
|
||||
- 콘솔에 `btn_prep` / `btn` 파싱 에러 없음.
|
||||
- 버튼 클릭 시 stone_button powered 애니메이션 발생하지 않음
|
||||
(interaction 박스가 한 두께 바깥에서 ray 를 가로채므로).
|
||||
- 라벨이 버튼 바로 아래 벽면에 굵게 표시.
|
||||
- 채팅정답 / 영상재생 모드 미설치 시 `/start` 가 사유 메시지와 함께 차단.
|
||||
- 모드 둘 다 정상 설치되어 있으면 `/start` 정상 진행.
|
||||
41
temp/data/mq/function/commands/start.mcfunction
Normal file
41
temp/data/mq/function/commands/start.mcfunction
Normal file
@@ -0,0 +1,41 @@
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 완전히 종료된후 시작해주세요.","color":"red","msg":""}
|
||||
|
||||
# ---- 외부 모드 설치 검증 ----
|
||||
# 두 모드는 성격이 달라서 검증 방식이 다름:
|
||||
#
|
||||
# * mq_chat_mod : mc_chat_answer_mod = 서버 전용 모드 (채팅 가로채기는
|
||||
# 서버에서 일어남, 클라 설치 불필요). 따라서 fake player `#server`
|
||||
# 점수를 모드가 매 server tick 마다 1 로 set. 서버에 모드가 없으면
|
||||
# 이 점수가 갱신되지 않음.
|
||||
#
|
||||
# * mq_video_mod : mc_video_player_mod = 클라이언트 측 렌더링 + 서버 측
|
||||
# 컴포넌트. 같은 objective 안에 holder 두 종류 사용:
|
||||
# - `#server mq_video_mod` : 서버 컴포넌트가 매 tick 1 로 갱신 (server
|
||||
# presence). 없으면 0 → 서버에 모드 미설치.
|
||||
# - `<player> mq_video_mod` : 클라 join 시 payload 가 서버로 오면 서버
|
||||
# 컴포넌트가 해당 플레이어 점수를 1 로 set (client presence). 클라
|
||||
# 미설치면 0 유지.
|
||||
# 이렇게 분리해야 "서버 미설치"와 "특정 플레이어 클라 미설치"가 안내에서
|
||||
# 구분된다.
|
||||
#
|
||||
# 1) 서버 측 모드 부재 — 전원 차단, 단일 안내. 서버 부재는 클라 검사보다
|
||||
# 우선해야 — 클라가 다 설치되어 있어도 서버가 없으면 동작 안 한다.
|
||||
execute unless score #server mq_chat_mod matches 1 run return run function mq:tellraw {"text":"채팅정답 모드가 서버에 미설치 — 서버 관리자에게 문의해주세요.","color":"red","msg":""}
|
||||
execute unless score #server mq_video_mod matches 1 run return run function mq:tellraw {"text":"영상재생 모드가 서버에 미설치 — 서버 관리자에게 문의해주세요.","color":"red","msg":""}
|
||||
|
||||
# 2) 클라이언트 측 모드 (mc_video_player_mod) 부재 — 본인 누락 안내 + 차단.
|
||||
# selector `scores={X=..0}` 는 점수 미존재를 매치하지 않으므로 직전에
|
||||
# `add @a ... 0` 으로 materialize. 개인 안내는 tellraw @s 직접 (mq:tellraw
|
||||
# 는 내부 @a broadcast 라 부적합).
|
||||
scoreboard players add @a mq_video_mod 0
|
||||
execute as @a[scores={mq_video_mod=..0}] run tellraw @s ["",{"text":"영상재생 모드 미설치 — 모드 적용 후 다시 입장해주세요.","color":"red"}]
|
||||
execute if entity @a[scores={mq_video_mod=..0}] run return run function mq:tellraw {"text":"필수 모드 미설치 플레이어가 있어 시작할 수 없습니다.","color":"red","msg":""}
|
||||
|
||||
setblock ~ ~ ~ minecraft:air
|
||||
|
||||
function mq:quiz/stop_sound
|
||||
|
||||
$scoreboard players set max_index main $(max_index)
|
||||
scoreboard players set init main 1
|
||||
|
||||
dialog show @a mq:page1
|
||||
47
temp/data/mq/function/load.mcfunction
Normal file
47
temp/data/mq/function/load.mcfunction
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
# 외부 모드 존재 확인용 점수.
|
||||
# mq_chat_mod : 서버 전용 모드(mc_chat_answer_mod). 모드가 매 server tick
|
||||
# 마다 fake player `#server` 점수를 1 로 set. 모드가 서버에 없으면 0 유지.
|
||||
# mq_video_mod : 클라이언트 모드(mc_video_player_mod). 클라 join 시 서버로
|
||||
# handshake payload 전송 → 서버 측 모드가 해당 플레이어 점수를 1 로 set.
|
||||
# 클라에 모드가 없으면 0 유지. (login.mcfunction 에서 플레이어별 0 초기화.)
|
||||
scoreboard objectives remove mq_chat_mod
|
||||
scoreboard objectives remove mq_video_mod
|
||||
scoreboard objectives add mq_chat_mod dummy
|
||||
scoreboard objectives add mq_video_mod dummy
|
||||
# /reload 후 모드가 한 tick 도 돌기 전에 start 가 호출될 수 있으니
|
||||
# #server 점수도 0 으로 materialize. 모드가 살아 있으면 다음 tick 에 1 로 갱신.
|
||||
# mq_video_mod 도 같은 objective 안에서 holder 만 다르게 — `#server` 는 서버
|
||||
# 컴포넌트 존재 (서버 측 모드가 매 tick 1 로 갱신), `<player>` 는 클라 측
|
||||
# 존재 (payload 수신 시 1 로 갱신).
|
||||
scoreboard players set #server mq_chat_mod 0
|
||||
scoreboard players set #server mq_video_mod 0
|
||||
|
||||
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
|
||||
117
temp/data/mq/function/repeat/buttons/btn.mcfunction
Normal file
117
temp/data/mq/function/repeat/buttons/btn.mcfunction
Normal file
@@ -0,0 +1,117 @@
|
||||
# warn-off-file always-pass-condition
|
||||
# 버튼 1개에 대한 매 tick 처리.
|
||||
# 매크로 인자(mq:tmp.btn): n, x, y, z, f, c, label, label_color, label_font, label_scale
|
||||
# buttons 점수 상태:
|
||||
# ..-2 : 비활성 (버튼 블록 제거, interaction 응답 차단)
|
||||
# -1 : 초기화 단계 (버튼 블록 + interaction × 3 + text_display 보장 후 0)
|
||||
# 0 : 정상 (interaction 클릭 대기)
|
||||
#
|
||||
# interaction/text_display entity 는 데이터팩이 직접 summon — /reload 시
|
||||
# commands/stop 에서 buttons 가 -1 로 재설정되어 다음 tick 에 ensure 로직
|
||||
# 실행. -1 단계에서 같은 태그 entity 를 모두 kill 후 정확한 개수만 다시
|
||||
# summon → 항상 idempotent (dup 누적 없음, 좌표/라벨 갱신 자동 반영).
|
||||
#
|
||||
# ---- facing → 머리 hitbox 위치 (이 파일 한 곳에서만 정의) ----
|
||||
# stone_button[face=wall, facing=X] AABB (블록 상대 좌표):
|
||||
# facing 의 의미 = "버튼 머리 visible 면의 normal 방향". 머리는 그 방향
|
||||
# 쪽 face 에 붙어 있고 hitbox 는 그 face 에서 안쪽(1/8) 만큼 들어감.
|
||||
# south : z ∈ [0, 0.125] 가로 x ∈ [0.3125, 0.6875]
|
||||
# north : z ∈ [0.875, 1] 가로 x ∈ [0.3125, 0.6875]
|
||||
# east : x ∈ [0, 0.125] 가로 z ∈ [0.3125, 0.6875]
|
||||
# west : x ∈ [0.875, 1] 가로 z ∈ [0.3125, 0.6875]
|
||||
# 세로 y ∈ [0.375, 0.625] 공통.
|
||||
#
|
||||
# interaction entity 의 horizontal hitbox 는 width × width 정사각형 강제라
|
||||
# 단일 entity 로는 "가로 0.375 × 두께 0.125" 직사각형 불가. → 두께(0.125)
|
||||
# 와 같은 width=0.125 인 interaction 을 가로축으로 3 개 타일링 (gap 없이
|
||||
# 인접: 중심 0.375 / 0.5 / 0.625, 각 폭 0.125 → 합 [0.3125, 0.6875]).
|
||||
# interaction Y 는 hitbox 바닥 → 소환 y = block y + 0.375, height = 0.25.
|
||||
#
|
||||
# ---- 깊이축: 블록 면 바로 바깥, 플레이어 쪽 (이중 트리거 방지) ----
|
||||
# interaction 박스가 stone_button hitbox 와 겹치면 한 번 클릭에 interaction
|
||||
# 도 발화하고 stone_button 도 vanilla 클릭으로 인식되어 powered=true 애니
|
||||
# 메이션이 같이 일어남. → interaction 박스를 버튼 머리 바깥쪽 (플레이어
|
||||
# 측) 으로 한 두께 (0.125) 만큼 밀어 ray 가 stone_button 에 닿기 전에
|
||||
# interaction 에서 멈추게.
|
||||
#
|
||||
# 주의: facing 은 "버튼 머리 normal 방향" = 플레이어가 보는 방향.
|
||||
# south 면 머리 +z 향함, 벽은 -z 쪽. 따라서 플레이어 쪽 = +z = interaction
|
||||
# 을 z > 버튼 머리 (0.125) 영역으로. (v1.0.21 에서 한 두께만큼 뺀다는
|
||||
# 의도였는데 부호를 반대로 잡아 interaction 이 벽 안으로 들어가 있었음.)
|
||||
# south : 깊이 z 중심 = 0.1875 (interaction z ∈ [0.125, 0.25], 버튼 z ∈ [0, 0.125])
|
||||
# north : 깊이 z 중심 = 0.8125 (interaction z ∈ [0.75, 0.875], 버튼 z ∈ [0.875, 1])
|
||||
# east : 깊이 x 중심 = 0.1875
|
||||
# west : 깊이 x 중심 = 0.8125
|
||||
#
|
||||
# ---- positioned 의 .5 보정 회피 ----
|
||||
# MC 의 vec3 인자는 정수만 쓰면 자동으로 +0.5 보정됨 (블록 중심으로 잡힘).
|
||||
# positioned 2773 86 5968 → 실제로는 (2773.5, 86, 5968.5). 거기서 ~ 오프셋
|
||||
# 을 더하면 박스 전체가 0.5 칸 어긋남. $(x).0 $(y).0 $(z).0 처럼 decimal
|
||||
# 형태로 넘기면 보정 없이 정확한 블록 origin (minimal corner) 이 됨.
|
||||
#
|
||||
# ---- text_display 위치 (버튼 바로 아래 같은 벽면에 가운데 정렬) ----
|
||||
# 버튼 아래 블록의 같은 벽면 (visible 면, 플레이어 쪽) 에 살짝 띄워 부착.
|
||||
# 가로축: ~0.5 (block 가로 중심, alignment=center 기본값과 합쳐져서 라벨
|
||||
# 자체도 수평 중앙).
|
||||
# 세로축: text_display 의 entity Y 는 텍스트 윗변 — 아래로 자람. ~-0.25
|
||||
# 로 두면 텍스트 윗변이 Y-0.25 (버튼 바로 아래), 한 줄(기본 ~0.5 블록 높이)
|
||||
# 이 Y-0.75 까지 내려와 버튼 아래 한 칸 벽면 [Y-1, Y] 의 위쪽 절반에
|
||||
# 자리잡음 — 시각적으로 버튼 바로 밑 가운데 라벨.
|
||||
# south : ~0.5 ~-0.25 ~0.01 yaw 0 (head 가 +z → 벽면 z=0 에서 +0.01 띄움)
|
||||
# north : ~0.5 ~-0.25 ~0.99 yaw 180
|
||||
# east : ~0.01 ~-0.25 ~0.5 yaw -90
|
||||
# west : ~0.99 ~-0.25 ~0.5 yaw 90
|
||||
|
||||
# ---- 비활성: 블록 + interaction × 3 + text_display 전부 제거 후 종료 ----
|
||||
# data modify entity @e[...] 는 대상 1개 강제 → interaction 3개 모드에선
|
||||
# 못 쓰므로 그냥 kill. 어차피 버튼 블록도 air 로 바꾸므로 라벨도 같이 제거.
|
||||
$execute if score $(n) buttons matches ..-2 run setblock $(x) $(y) $(z) minecraft:air
|
||||
$execute if score $(n) buttons matches ..-2 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction]
|
||||
# $execute if score $(n) buttons matches ..-2 run kill @e[type=minecraft:text_display,tag=mq,tag=$(n)]
|
||||
$execute if score $(n) buttons matches ..-2 run return 0
|
||||
|
||||
# ---- 초기화: 블록 + interaction × 3 + text_display 보장 ----
|
||||
$execute unless score $(n) buttons matches -1.. run scoreboard players set $(n) buttons -1
|
||||
$execute if score $(n) buttons matches -1 run setblock $(x) $(y) $(z) minecraft:stone_button[face=wall,facing=$(f),powered=false]
|
||||
$execute if score $(n) buttons matches -1 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction]
|
||||
$execute if score $(n) buttons matches -1 run kill @e[distance=0..,tag=mq,tag=$(n),type=minecraft:text_display]
|
||||
|
||||
# south: 깊이축=z(+0.1875, 플레이어 쪽), 가로축=x, 3 타일 + 라벨
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.37 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.5 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.63 ~0.37 ~0.07 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"south"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.5 ~-0.5 ~0.01 {Tags:["mq","$(n)"],Rotation:[0f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
|
||||
|
||||
# north: 깊이축=z(+0.8125, 플레이어 쪽), 가로축=x, 3 타일 + 라벨
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.37 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.5 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.63 ~0.37 ~0.93 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"north"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.5 ~-0.5 ~0.99 {Tags:["mq","$(n)"],Rotation:[180f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
|
||||
|
||||
# east: 깊이축=x(+0.1875, 플레이어 쪽), 가로축=z, 3 타일 + 라벨
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.37 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.5 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.07 ~0.37 ~0.63 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"east"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.01 ~-0.5 ~0.5 {Tags:["mq","$(n)"],Rotation:[-90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
|
||||
|
||||
# west: 깊이축=x(+0.8125, 플레이어 쪽), 가로축=z, 3 타일 + 라벨
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.37 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.5 {Tags:["mq","$(n)"],width:0.13f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:interaction ~0.93 ~0.37 ~0.63 {Tags:["mq","$(n)"],width:0.125f,height:0.26f,response:0b}
|
||||
$execute if score $(n) buttons matches -1 unless data storage mq:tmp btn{label:""} if data storage mq:tmp btn{f:"west"} positioned $(x).0 $(y).0 $(z).0 run summon minecraft:text_display ~0.99 ~-0.5 ~0.5 {Tags:["mq","$(n)"],Rotation:[90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)",bold:true},transformation:{scale:[$(label_scale)f,$(label_scale)f,$(label_scale)f],translation:[0f,0f,0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
|
||||
|
||||
$execute if score $(n) buttons matches -1 run scoreboard players set $(n) buttons 0
|
||||
|
||||
# ---- 상시: interaction 클릭/타격 → playsound + 명령/투표 실행 ----
|
||||
# init main = 0 (퀴즈 시작 전 설정 단계) : 명령 직접 실행
|
||||
# 그 외 : trigger 투표 경로
|
||||
# 한 버튼에 interaction 3개지만 `on target` 은 클릭된 1개만 통과
|
||||
# (나머지는 target 부재로 체인 중단). limit=1 을 두면 MC 가 임의로 1개를
|
||||
# 골라 잘못된 entity 만 검사하므로 limit 두지 않음.
|
||||
$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 as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 0 run $(c)
|
||||
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] on target as @s positioned $(x).0 $(y).0 $(z).0 unless score init main matches 0 run trigger $(n)
|
||||
|
||||
# ---- 처리 후 attack/interaction NBT 클리어 (다음 tick 중복 발화 방지) ----
|
||||
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] at @s run data remove entity @s attack
|
||||
$execute as @e[distance=0..,tag=mq,tag=$(n),type=minecraft:interaction] at @s run data remove entity @s interaction
|
||||
21
temp/data/mq/function/repeat/buttons/btn_prep.mcfunction
Normal file
21
temp/data/mq/function/repeat/buttons/btn_prep.mcfunction
Normal file
@@ -0,0 +1,21 @@
|
||||
# 한 button entry 의 optional 필드 기본값을 채워 macro 호출 시 $(arg) 미존재
|
||||
# 에러를 방지한다. handler 에서 entry 복사 직후 호출.
|
||||
#
|
||||
# label : 없으면 "" (빈 문자열) -> btn 안의 text_display 분기는 label
|
||||
# 이 "" 이면 스킵.
|
||||
# label_color : 기본 "black"
|
||||
# label_font : 기본 "minecraft:default"
|
||||
# label_scale : 기본 "1.0" (Vector3f 의 한 축, 3축 동일하게 사용됨)
|
||||
#
|
||||
# 구현: defaults 컴파운드를 먼저 만들고 entry (mq:tmp.btn) 를 그 위에 merge
|
||||
# 한 뒤 다시 mq:tmp.btn 으로 되돌린다. data modify ... merge from 은 source
|
||||
# compound 의 키로 target compound 를 덮어쓰므로 entry 에 있는 값은 보존되고
|
||||
# entry 에 없는 키만 default 값으로 채워진다.
|
||||
#
|
||||
# (이전에 `execute unless data storage mq:tmp btn.label run data modify ...`
|
||||
# 방식이었으나 MC 26.1.2 parser 가 해당 라인을 거부했음. merge 방식은 문제
|
||||
# 난 execute-unless-data 구문 자체를 제거.)
|
||||
|
||||
data modify storage mq:tmp btn_default set value {label:"",label_color:"black",label_font:"minecraft:default",label_scale:"1.0"}
|
||||
data modify storage mq:tmp btn_default merge from storage mq:tmp btn
|
||||
data modify storage mq:tmp btn set from storage mq:tmp btn_default
|
||||
27
temp/data/mq/function/repeat/buttons/handler.mcfunction
Normal file
27
temp/data/mq/function/repeat/buttons/handler.mcfunction
Normal file
@@ -0,0 +1,27 @@
|
||||
# 각 button_defs 항목을 mq:tmp.btn 으로 복사 → optional 필드 기본값 채움
|
||||
# → btn 호출. btn 안에서 facing 별 분기 (if data storage mq:tmp btn{f:"..."})
|
||||
# 와 macro arg ($(label) 등) 둘 다 사용 가능하게 같은 storage 에 노출시킨다.
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[0]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[1]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[2]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[3]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[4]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
|
||||
data modify storage mq:tmp btn set from storage mq:main button_defs[5]
|
||||
function mq:repeat/buttons/btn_prep
|
||||
function mq:repeat/buttons/btn with storage mq:tmp btn
|
||||
15
temp/data/mq/function/repeat/timer.mcfunction
Normal file
15
temp/data/mq/function/repeat/timer.mcfunction
Normal file
@@ -0,0 +1,15 @@
|
||||
execute if score timer main matches 1.. run scoreboard players add timer main 1
|
||||
|
||||
execute unless score init main matches 2 \
|
||||
unless score init main matches 6 \
|
||||
unless score init main matches 10 \
|
||||
run scoreboard players set timer main 0
|
||||
|
||||
# start title timer
|
||||
execute if score init main matches 2 run function mq:repeat/timers/init2
|
||||
|
||||
# next song timer
|
||||
execute if score init main matches 6 run function mq:repeat/timers/init6
|
||||
|
||||
# endding timer
|
||||
execute if score init main matches 10 run function mq:repeat/timers/init10
|
||||
3
temp/data/mq/function/repeat/timers/init10.mcfunction
Normal file
3
temp/data/mq/function/repeat/timers/init10.mcfunction
Normal file
@@ -0,0 +1,3 @@
|
||||
execute if score timer main matches 300 run title @a title {"text":""}
|
||||
execute if score timer main matches 290 run function mq:images/clear
|
||||
execute if score timer main matches 300.. run function mq:quiz/select with storage mq:main
|
||||
15
temp/data/mq/function/repeat/timers/init2.mcfunction
Normal file
15
temp/data/mq/function/repeat/timers/init2.mcfunction
Normal file
@@ -0,0 +1,15 @@
|
||||
# warn-off-file execute-group
|
||||
execute if score timer main matches 20 run title @a title {"text":"3"}
|
||||
execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 20 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 40 run title @a title {"text":"2"}
|
||||
execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 40 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 60 run title @a title {"text":"1"}
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:block.note_block.iron_xylophone weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 100 run title @a title {"text":""}
|
||||
execute if score timer main matches 100.. run function mq:quiz/select with storage mq:main
|
||||
15
temp/data/mq/function/repeat/timers/init6.mcfunction
Normal file
15
temp/data/mq/function/repeat/timers/init6.mcfunction
Normal file
@@ -0,0 +1,15 @@
|
||||
# warn-off-file execute-group
|
||||
execute if score timer main matches 60 run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"white","msg":""}
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 180 run function mq:tellraw {"text":"퀴즈를 다시 시작하시려면 종료를 눌러주세요.","color":"white","msg":""}
|
||||
execute if score timer main matches 120 as @a at @s run scoreboard players set stop buttons -1
|
||||
execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 120 run function mq:tellraw {"text":"플레이 해주셔서 감사합니다.","color":"white","msg":""}
|
||||
execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score timer main matches 200.. run scoreboard players set init main 11
|
||||
Reference in New Issue
Block a user