Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8d5e75e7d | ||
|
|
6956c60461 | ||
|
|
8fc4f164ae |
141
README.md
141
README.md
@@ -16,20 +16,39 @@
|
||||
|
||||
### 호환 버전
|
||||
|
||||
- **Minecraft 26.1.2** (pack_format `75`) 기준.
|
||||
- **Minecraft 26.1.2** (`pack.mcmeta` 의 `min_format`/`max_format` 모두
|
||||
`[101, 1]`).
|
||||
- 1.21.6에서 도입된 `dialog` 시스템, 1.21+의 단수형 `function/` 태그 폴더,
|
||||
매크로 함수(`function ... with storage`) 기능을 사용한다.
|
||||
- 텍스트 컴포넌트는 JSON 표기로 작성돼 있으며, 1.21.5 이후의 SNBT 파서와도
|
||||
호환된다 (JSON은 SNBT의 부분집합).
|
||||
|
||||
### 100% 바닐라 — 의존 플러그인 없음
|
||||
### 외부 모드 의존성 (서버/클라)
|
||||
|
||||
서버 측 검증이 들어가 있어 다음 두 모드가 반드시 깔려 있어야 `/start` 가
|
||||
진행된다. 미설치 시 `commands/start` 의 게이트가 사유와 함께 차단한다.
|
||||
|
||||
- **`mc_chat_answer_mod` v1.3.7+** — 서버 전용. 채팅으로 정답 입력을
|
||||
받는다. presence 는 `#server mq_chat_mod` 점수로 매 tick 표시되며,
|
||||
`SERVER_STARTED` / `END_DATA_PACK_RELOAD` / `PlayerJoin` / `ServerTick`
|
||||
네 지점에서 갱신된다.
|
||||
https://git.tkrmagid.kr/tkrmagid/mc_chat_answer_mod/releases/tag/v1.3.7
|
||||
- **`mc_video_player_mod`** — 클라이언트 + 서버 모두 필요. 서버 컴포넌트가
|
||||
`#server mq_video_mod` 를 1 로 갱신하고, 클라 join handshake 가 도착하면
|
||||
`<player> mq_video_mod` 를 1 로 set. `/start` 는 서버 부재 시 단일 차단,
|
||||
특정 플레이어 부재 시 본인에게 안내 + 게임 시작 차단.
|
||||
|
||||
### 100% 바닐라 — 의존 플러그인 없음 (모드 외)
|
||||
|
||||
음원 재생과 정답 이미지 표시는 모두 바닐라 명령으로 처리한다. 음원과
|
||||
페인팅 텍스처는 [minecraft_launcher](https://git.tkrmagid.kr/tkrmagid/minecraft_launcher)
|
||||
가 만들어주는 리소스팩(`musicquiz` 네임스페이스)에서 가져온다.
|
||||
|
||||
- 음원: `/playsound musicquiz:track_NN <source> @s ~ ~ ~ <volume> <pitch>`
|
||||
(예: `musicquiz:track_01`). 채널은 기본 `weather` — `stopsound` 와 함께 묶여 있다.
|
||||
(예: `musicquiz:track_01`). `init/config.mcfunction` 의 `audio.source` 가
|
||||
채널을 결정하며, **곡 재생은 기본 `player` 채널** (음성/플레이어 볼륨
|
||||
슬라이더로 음량 제어). `stopsound` 도 같은 채널로 묶여 있다. 카운트다운
|
||||
비프와 종료 클릭 같은 UI 사운드는 별도로 `weather` 채널을 사용한다.
|
||||
- 정답 이미지: `painting_variant musicquiz:cover_NN` 을 `/summon painting` 으로
|
||||
벽에 띄우고, 다음 곡 직전 `kill @e[type=painting,tag=mq_cover]` 로 제거.
|
||||
|
||||
@@ -71,29 +90,44 @@
|
||||
|
||||
### 입력 버튼
|
||||
|
||||
관리자가 사용하는 6개의 물리 스톤 버튼. 좌표·표면 방향·실행 명령은
|
||||
관리자가 사용하는 6개의 물리 스톤 버튼. 좌표·표면 방향·실행 명령·라벨은
|
||||
`mq:init/buttons`에서 storage 리스트(`mq:main button_defs`)로 관리되며,
|
||||
`mq:repeat/buttons/handler`가 매 틱 storage 인덱스로 `btn` 매크로를 호출한다.
|
||||
`mq:repeat/buttons/handler`가 매 틱 storage 인덱스로 `btn_prep` →
|
||||
`btn` 매크로 체인을 호출한다.
|
||||
|
||||
- `start` / `stop` / `skip` / `hint` / `replay` / `test`
|
||||
|
||||
버튼 본체는 보이는 `stone_button` 블록 + 그 좌표에 덮인 `interaction`
|
||||
엔티티로 구성된다. 클릭 처리는 항상 `interaction` 경로로 흐르므로
|
||||
`on target as @s` 로 누른 플레이어가 식별되고, 다수결(`trigger $(n)`)
|
||||
투표가 성립한다.
|
||||
버튼 본체는 보이는 `stone_button` 블록 + 클릭을 받는 `interaction` 엔티티
|
||||
3 타일 (블록 면 바깥, 플레이어 쪽으로 살짝 튀어나오게) + 버튼 바로 아래
|
||||
벽면에 부착되는 `text_display` 라벨 1 개로 구성된다. interaction 폭이
|
||||
`width × width` 정사각형으로 강제되기 때문에 stone_button hitbox 의 가로
|
||||
0.375 를 0.125 폭 × 3 타일로 덮고, 깊이는 두께(0.125) 만큼 밖으로 밀어
|
||||
vanilla stone_button 클릭이 동시에 발화되지 않도록 한다. 라벨은 `bold`
|
||||
적용 text component 로 직접 렌더링된다.
|
||||
|
||||
`interaction` 은 데이터팩이 직접 소환·관리한다 — `buttons` 점수가
|
||||
`-1` (초기화) 일 때마다 같은 태그의 기존 entity 를 정리하고 정확히
|
||||
1개를 (재)소환한다. `/reload` 가 `commands/stop` 을 호출해 `buttons`
|
||||
점수를 `-1` 로 재설정하므로, 리로드 시 자동 보장된다. `/kill @e` 로
|
||||
지워졌어도 다음 `/reload` 한 번으로 복구. 월드 회로(커맨드블럭) 의존은
|
||||
없다.
|
||||
각 `button_defs` 항목의 필드:
|
||||
|
||||
- 필수: `n` (이름·태그), `x,y,z`, `f` (facing), `c` (실행 명령)
|
||||
- 옵션: `label`, `label_color` (기본 `black`), `label_font` (기본
|
||||
`minecraft:default`), `label_scale` (기본 `1.0`). `btn_prep` 에서
|
||||
defaults + `merge from` 패턴으로 기본값이 자동 채워진다.
|
||||
|
||||
클릭 처리는 항상 `interaction` 경로로 흐르므로 `on target as @s` 로 누른
|
||||
플레이어가 식별되고, 다수결(`trigger $(n)`) 투표가 성립한다.
|
||||
|
||||
`interaction` / `text_display` 는 데이터팩이 직접 소환·관리한다 —
|
||||
`buttons` 점수가 `-1` (초기화) 일 때마다 같은 태그의 기존 entity 를
|
||||
정리하고 정확한 개수만 (재)소환한다. `/reload` 가 `commands/stop` 을
|
||||
호출해 `buttons` 점수를 `-1` 로 재설정하므로 리로드 시 자동 보장된다.
|
||||
`/kill @e` 로 지워졌어도 다음 `/reload` 한 번으로 복구. 월드 회로
|
||||
(커맨드블럭) 의존은 없다.
|
||||
|
||||
### 파일 구조
|
||||
|
||||
```
|
||||
music_quiz/
|
||||
├── pack.mcmeta # pack_format 75
|
||||
├── pack.mcmeta # min_format/max_format [101, 1]
|
||||
├── pack.png
|
||||
└── data/
|
||||
├── minecraft/tags/function/
|
||||
│ ├── load.json # → mq:load
|
||||
@@ -106,9 +140,9 @@ music_quiz/
|
||||
│ ├── tick.mcfunction # 매 틱 서브함수 디스패치 (init 게이팅)
|
||||
│ ├── tellraw.mcfunction # 매크로 prefix 메시지 헬퍼
|
||||
│ ├── init/ # 사용자 설정·정적 데이터 (수정 포인트)
|
||||
│ │ ├── config.mcfunction # 주제·스폰·오디오·페인팅·marker 설정
|
||||
│ │ ├── config.mcfunction # 주제·스폰·오디오·페인팅 설정
|
||||
│ │ ├── songs.mcfunction # 곡 목록 + max_index 자동계산
|
||||
│ │ ├── buttons.mcfunction # 버튼 좌표·실행 명령
|
||||
│ │ ├── buttons.mcfunction # 버튼 좌표·실행 명령·라벨
|
||||
│ │ └── triggers.mcfunction # 다수결 트리거 정의
|
||||
│ ├── commands/ # start·stop·skip·hint·replay·test
|
||||
│ ├── quiz/ # 게임 진행 로직
|
||||
@@ -117,18 +151,20 @@ music_quiz/
|
||||
│ │ └── macro/ # 매크로 진입점
|
||||
│ │ ├── setanswer.mcfunction # songs[$(idx)] → answer + track/cover id
|
||||
│ │ ├── play_sound.mcfunction # $playsound 매크로
|
||||
│ │ ├── stop_sound.mcfunction # $stopsound 매크로
|
||||
│ │ └── summon{,2}.mcfunction # 정답 marker 엔티티 + alias 체인
|
||||
│ │ └── stop_sound.mcfunction # $stopsound 매크로
|
||||
│ ├── images/ # 정답 페인팅 표시·제거
|
||||
│ │ ├── show.mcfunction # cover painting 소환
|
||||
│ │ ├── clear.mcfunction # cover painting 일괄 제거
|
||||
│ │ └── macro/show.mcfunction # $summon painting 매크로
|
||||
│ ├── repeat/ # tick에서 호출되는 매 틱 처리
|
||||
│ │ ├── players·check_answer·timer.mcfunction
|
||||
│ │ ├── buttons/{handler,btn}.mcfunction
|
||||
│ │ ├── timers/{init2,init6,init10}.mcfunction # init 단계별 timer 디스패치 분할
|
||||
│ │ ├── buttons/{handler,btn_prep,btn}.mcfunction
|
||||
│ │ └── triggers/{handler,trigger}.mcfunction
|
||||
│ └── players/login.mcfunction
|
||||
│ ├── answer/ # 채팅 정답 입력 정규화/판정 (chat_answer 모드 경로)
|
||||
│ └── players/{login,mod_active_notice}.mcfunction
|
||||
├── dialog/page{1,2,3}.json
|
||||
├── painting_variant/{cover_01..50,gif}.json
|
||||
└── advancement/player/login.json
|
||||
```
|
||||
|
||||
@@ -150,21 +186,24 @@ music_quiz/
|
||||
- `title`, `max_index`, `spawn` — 설정
|
||||
- `audio` = `{namespace, source, volume, pitch}` — `/playsound` 파라미터
|
||||
- `image` = `{namespace, x, y, z, facing}` — 정답 페인팅 좌표
|
||||
- `marker` = `{x, y, z}` — 정답 입력 marker 엔티티 위치
|
||||
- `answer` = `{title, author, alias, track, cover}` — 현재 곡 정답
|
||||
- `songs` — 곡 목록 (`mq:init/songs` 가 채움)
|
||||
- `button_defs` / `trigger_defs` — 버튼·트리거 정의
|
||||
- `mq:tmp` — setanswer·play_sound·페인팅 호출용 임시 페이로드 (idx, pad, num, playsound, painting, marker_call)
|
||||
- `mq:tmp` — setanswer·play_sound·페인팅·버튼 호출용 임시 페이로드 (idx, pad, num, playsound, painting, btn, btn_default)
|
||||
- `mq:input` — 채팅 정답 입력 큐 (chat_answer 모드 경로)
|
||||
- `func:temp` — `func:` 헬퍼 함수용 임시 NBT
|
||||
|
||||
> 참고: 과거 `marker` 스토리지와 `minecraft:marker` 정답 입력 엔티티는
|
||||
> 폐기됨. `commands/stop` 의 `kill @e[type=marker,tag=mq]` 한 줄만 이전
|
||||
> 월드에 남아 있을 수 있는 legacy entity 청소 목적으로 유지된다.
|
||||
|
||||
### 설정 (한 곳에서 수정)
|
||||
|
||||
세계마다 다른 값은 모두 `data/mq/function/init/` 폴더에서 편집한다.
|
||||
`/reload` 후 반영된다.
|
||||
|
||||
- **`init/config.mcfunction`** — 주제, 스폰 위치, 오디오 설정(`audio`),
|
||||
정답 페인팅 좌표(`image`), marker 엔티티 좌표. `title` 은 `[ … ]`
|
||||
채팅 접두사로도 사용된다.
|
||||
정답 페인팅 좌표(`image`). `title` 은 `[ … ]` 채팅 접두사로도 사용된다.
|
||||
- **`init/songs.mcfunction`** — 곡 목록 (한 줄에 한 곡씩 append). `alias`
|
||||
배열의 문자열은 정답 판정 시 동의어로 인정된다. **곡의 순서가 리소스팩
|
||||
트랙 번호와 1:1 매칭** 되므로 순서 변경 시 리소스팩도 함께 재생성해야
|
||||
@@ -183,31 +222,59 @@ JSON 텍스트 컴포넌트가 storage 참조를 일관되게 지원하지 않
|
||||
### 설치
|
||||
|
||||
1. 서버 월드 폴더 `datapacks/`에 `music_quiz/` 디렉터리째 복사.
|
||||
2. minecraft_launcher 에서 생성한 `musicquiz` 리소스팩을 클라이언트에 적용
|
||||
2. 서버 mods 폴더에 `mc_chat_answer_mod` v1.3.7+ 와 `mc_video_player_mod`
|
||||
jar 설치. `mc_video_player_mod` 는 클라이언트 측에도 설치 필요.
|
||||
3. minecraft_launcher 에서 생성한 `musicquiz` 리소스팩을 클라이언트에 적용
|
||||
(런처가 자동 처리).
|
||||
3. 서버 `/reload` — 리로드 성공 메시지가 채팅에 표시되면 정상.
|
||||
4. 좌표 `144, 62, -225` 부근에 6개 버튼이 자동 배치된다.
|
||||
5. `start` 버튼을 눌러 게임 시작.
|
||||
4. 서버 `/reload` — 리로드 성공 메시지가 채팅에 표시되면 정상.
|
||||
5. `mq:init/buttons` 에 정의된 좌표 부근에 6개 버튼이 자동 배치된다.
|
||||
6. `start` 버튼을 눌러 게임 시작 — 모드 미설치 시 사유와 함께 차단된다.
|
||||
|
||||
### 좌표 의존성 (주의)
|
||||
|
||||
다음 좌표가 데이터팩 안에 박혀 있어, 다른 월드에서 그대로 사용하려면
|
||||
`init/config.mcfunction` 의 값을 바꿔야 한다:
|
||||
다음 좌표는 데이터팩 안에 박혀 있어 다른 월드에서 쓰려면 직접 바꿔야
|
||||
한다. 현재 박혀 있는 좌표는 본인 월드 기준이므로 그대로 옮겨가면 동작
|
||||
안 한다.
|
||||
|
||||
- 정답 입력 marker: `144 59 -219` — `marker.{x,y,z}`
|
||||
- 정답 페인팅: `144 84 -261` (facing south) — `image.{x,y,z,facing}`
|
||||
- 플레이어 스폰: `144 61 -219` (yaw 180) — `spawn`
|
||||
- 버튼 좌표: `140..148, 62, -225` / `144, 62, -213` — `mq:init/buttons`
|
||||
- 정답 페인팅 / 플레이어 스폰 — `init/config.mcfunction` (`image`, `spawn`)
|
||||
- 버튼 좌표·facing — `init/buttons.mcfunction` (`button_defs` 의 `x,y,z,f`)
|
||||
|
||||
---
|
||||
|
||||
## 변경 이력
|
||||
|
||||
### 2026-05-19 — v1.0.25: 버튼 hitbox/라벨 미세조정 + 곡목록·좌표 갱신
|
||||
|
||||
- `repeat/buttons/btn.mcfunction`: interaction hitbox 미세조정 (`width`
|
||||
0.13 가운데 타일로 micro-gap 보정, `height` 0.26, 깊이 오프셋
|
||||
0.07/0.93, text_display Y `~-0.5` 로 라벨 위치 조정).
|
||||
- 셀렉터 정렬 `[type=...,tag=mq,tag=$(n)]` → `[distance=0..,tag=mq,
|
||||
tag=$(n),type=...]`.
|
||||
- `init/songs.mcfunction`: 아이유 17 곡 셋으로 교체 (alias 빈 배열).
|
||||
- `init/buttons.mcfunction`: 버튼 좌표 본인 월드 기준으로 갱신,
|
||||
`label` 필드 추가 ("게임시작" / "정지" / "넘기기" / "힌트" /
|
||||
"다시듣기" / "소리 테스트").
|
||||
- `repeat/timer.mcfunction` 분할 → `repeat/timers/{init2,init6,init10}`.
|
||||
- `commands/start.mcfunction` 에 `mq_video_mod` 게이트 추가 (서버 부재
|
||||
단일 차단 + 플레이어별 부재 안내). `load.mcfunction` 에 `mq_video_mod`
|
||||
objective + `#server` 0 materialize 추가.
|
||||
|
||||
### 2026-05-18 ~ 19 — v1.0.19 ~ v1.0.24: 버튼 인프라 안정화
|
||||
|
||||
- v1.0.19/20/21: `btn_prep` defaults+merge 패턴, `positioned $(x).0`
|
||||
로 +0.5 보정 회피, interaction 3 타일 분할, `text_display` 도입.
|
||||
- v1.0.23: 채팅정답 모드 false negative 의 진짜 fix — 데이터팩 게이트는
|
||||
유지하고 모드 (`mc_chat_answer_mod` v1.3.7) 의 presence pulse 를
|
||||
4 지점으로 확장.
|
||||
- v1.0.24: `text_display` Y 보정 (`~-1` → `~-0.25`) + 라벨 bold + v1.0.21
|
||||
의 interaction 깊이 부호 반전 수정.
|
||||
|
||||
### 2026-05-13 — 26.1.2 호환 + 1차 정리 (`b1babad`)
|
||||
|
||||
이전 푸시본(`6841b7a 이전퀴즈 데이터팩`)을 26.1.2 기준으로 정비.
|
||||
|
||||
- `pack_format` 69 → 75 (MC 26.1.2 / 1.21.11)
|
||||
- `pack_format` 69 → 75 (MC 26.1.2 / 1.21.11). 이후 `min_format`/
|
||||
`max_format` 가 `[101, 1]` 로 갱신됨 (현재).
|
||||
- `mq:load`, `mq:players/login`, `mq:commands/start`, `mq:commands/stop`,
|
||||
`mq:quiz/start`, `mq:quiz/end`, `mq:repeat/buttons/btn` 등에 남아 있던
|
||||
`# say ...` / `# stopsound` 사문화 디버그 주석 제거
|
||||
|
||||
@@ -3,6 +3,7 @@ data modify storage func:temp zero set value 0
|
||||
$data modify storage func:temp length set value $(length)
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"}
|
||||
# warn-off execute-group
|
||||
execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"}
|
||||
execute if score result func.temp matches 1 run return 0
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ execute if score length func.temp matches 0 run return 1
|
||||
execute store result score random func.temp run random value 0..2147483646
|
||||
scoreboard players operation random func.temp %= length func.temp
|
||||
|
||||
execute run function func:shuffle/f2 with storage func:temp {index:0}
|
||||
function func:shuffle/f2 with storage func:temp {index:0}
|
||||
|
||||
execute store result storage func:temp shuffle.index int 1 run scoreboard players get random func.temp
|
||||
function func:shuffle/f2 with storage func:temp shuffle
|
||||
|
||||
@@ -3,6 +3,7 @@ data modify storage func:temp zero set value 0
|
||||
$data modify storage func:temp length set value $(length)
|
||||
|
||||
execute store result score result func.temp run function func:comp_num {n1:"zero",n2:"length"}
|
||||
# warn-off execute-group
|
||||
execute if score result func.temp matches 1 run tellraw @s {"text":"length는 1이상 이어야 합니다.","color":"red"}
|
||||
execute if score result func.temp matches 1 run return 0
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ execute store result score result func.temp run function func:is_space with stor
|
||||
|
||||
$execute store result score result2 func.temp run function func:is_index {l1:"half",l2:"result",index:$(index)}
|
||||
|
||||
# warn-off execute-group
|
||||
execute if score result2 func.temp matches 0 if score result func.temp matches 0 run data modify storage func:temp text_list append value "■"
|
||||
execute if score result2 func.temp matches 0 if score result func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text
|
||||
execute if score result2 func.temp matches 1 run data modify storage func:temp text_list append from storage func:temp space.text
|
||||
|
||||
@@ -9,6 +9,7 @@ data modify storage mq:tmp judge.answer set from storage mq:tmp norm.acc
|
||||
function mq:answer/macro/match with storage mq:tmp judge
|
||||
|
||||
# 2) 제목 매치 실패 시 alias 들과 순차 비교 (조기 종료)
|
||||
# warn-off execute-group
|
||||
execute unless score @s answer matches 1 run data modify storage mq:tmp aliases set from storage mq:main answer.alias
|
||||
execute unless score @s answer matches 1 run function mq:answer/iter_aliases
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex
|
||||
execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'}
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'}
|
||||
|
||||
# warn-off execute-group
|
||||
execute if score init main matches 5 run data modify storage mq:main hint.text set from storage mq:main answer.title
|
||||
execute if score init main matches 5 run data modify storage mq:main hint.hint set value ""
|
||||
execute if score init main matches 5 run function func:hint with storage mq:main hint
|
||||
|
||||
@@ -5,5 +5,6 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex
|
||||
execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'}
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'}
|
||||
|
||||
# warn-off execute-group
|
||||
execute if score init main matches 5 run function mq:quiz/stop_sound
|
||||
execute if score init main matches 5 run function mq:quiz/play_sound
|
||||
|
||||
@@ -5,5 +5,6 @@ execute if score init main matches 1..4 run return run function mq:tellraw {"tex
|
||||
execute if score init main matches 6.. run return run function mq:tellraw {"text":"아직 다음노래가 재생되지 않았습니다.","color":"red",msg:'""'}
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"red",msg:'""'}
|
||||
|
||||
# warn-off execute-group
|
||||
execute if score init main matches 5 run scoreboard players set skip buttons -2
|
||||
execute if score init main matches 5 run function mq:quiz/correct
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 완전히 종료된후 시작해주세요.","color":"red","msg":""}
|
||||
|
||||
# ---- 외부 모드 설치 검증 ----
|
||||
# mq_video_mod (mc_video_player_mod) 만 게이트. 영상 렌더링은 클라 모드가
|
||||
# 필수라 없으면 게임이 의미가 없음. same objective 안에 holder 두 종류:
|
||||
# 두 모드는 성격이 달라서 검증 방식이 다름:
|
||||
#
|
||||
# * 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 유지.
|
||||
# 이렇게 분리해야 "서버 미설치"와 "특정 플레이어 클라 미설치"가 안내에서
|
||||
# 구분된다.
|
||||
#
|
||||
# mq_chat_mod (mc_chat_answer_mod) 는 게이트하지 않음 — 채팅 모드는 입력을
|
||||
# "편하게" 만들어주는 옵션일 뿐이고, 모드 없는 환경에서도 `/trigger input`
|
||||
# dialog 경로로 정답 제출이 가능. 과거에 게이트해 두면 모드 presence pulse
|
||||
# 가 호스트 환경 (banner/mohist 같은 fabric-bukkit 하이브리드) 에서 안
|
||||
# 들어오거나, 사용자 모드 버전이 presence tick 이전 (v1.3.4 이하) 일 때
|
||||
# false negative 로 시작이 막혔음.
|
||||
#
|
||||
# 1) 서버 측 영상 모드 부재 — 전원 차단, 단일 안내.
|
||||
# 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) 부재 — 본인 누락 안내 + 차단.
|
||||
|
||||
@@ -64,13 +64,13 @@ bossbar set mq:process players @a
|
||||
data modify storage mq:main answer set value {title:"음악퀴즈", alias:[]}
|
||||
|
||||
# 이전 버전이 남긴 legacy marker 정리 (현재는 marker 사용 안 함)
|
||||
kill @e[type=minecraft:marker,tag=mq]
|
||||
kill @e[distance=0..,tag=mq,type=minecraft:marker]
|
||||
|
||||
# 이전 버전이 남긴 잔존 text_display 정리.
|
||||
# 현재 버튼은 -1 init 단계에서 같은 tag interaction 만 kill 하므로 (n 태그
|
||||
# 가 일치할 때만), 옛 버튼 정의에 있던 이름의 text_display 가 남으면 안
|
||||
# 지워짐. 여기서 mq 태그 전체를 한 번에 정리해 stale 제거.
|
||||
kill @e[type=minecraft:text_display,tag=mq]
|
||||
kill @e[distance=0..,tag=mq,type=minecraft:text_display]
|
||||
|
||||
function mq:quiz/stop_sound
|
||||
function mq:images/clear
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
stopsound @a block minecraft:block.stone_button.click_on
|
||||
function mq:tellraw {"text":"띵!!!","color":"white","msg":'""'}
|
||||
# warn-off execute-group
|
||||
execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9
|
||||
execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9
|
||||
execute as @a at @s run playsound minecraft:block.note_block.bell weather @s ~ ~ ~ 1 0.9
|
||||
|
||||
@@ -1 +1 @@
|
||||
kill @e[type=minecraft:painting,tag=mq_cover]
|
||||
kill @e[distance=0..,tag=mq_cover,type=minecraft:painting]
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
# repeat/buttons/btn 안에서 한 곳에만 정의되어 있다.
|
||||
|
||||
data modify storage mq:main button_defs set value []
|
||||
data modify storage mq:main button_defs append value {n:"start", x:364, y:146, z:-263, f:"east", c:"function mq:commands/start with storage mq:main", label:"게임시작"}
|
||||
data modify storage mq:main button_defs append value {n:"stop", x:364, y:146, z:-265, f:"east", c:"function mq:commands/stop with storage mq:main", label:"정지"}
|
||||
data modify storage mq:main button_defs append value {n:"skip", x:364, y:146, z:-267, f:"east", c:"function mq:commands/skip", label:"넘기기"}
|
||||
data modify storage mq:main button_defs append value {n:"hint", x:364, y:146, z:-269, f:"east", c:"function mq:commands/hint", label:"힌트"}
|
||||
data modify storage mq:main button_defs append value {n:"replay", x:364, y:146, z:-271, f:"east", c:"function mq:commands/replay", label:"다시듣기"}
|
||||
data modify storage mq:main button_defs append value {n:"test", x:144, y:62, z:-213, f:"north", c:"function mq:commands/test", label:"소리 테스트"}
|
||||
data modify storage mq:main button_defs append value {n:"start", x:2773, y:86, z:5968, f:"north", c:"function mq:commands/start with storage mq:main", label:"게임시작"}
|
||||
data modify storage mq:main button_defs append value {n:"stop", x:2771, y:86, z:5968, f:"north", c:"function mq:commands/stop with storage mq:main", label:"정지"}
|
||||
data modify storage mq:main button_defs append value {n:"skip", x:2769, y:86, z:5968, f:"north", c:"function mq:commands/skip", label:"넘기기"}
|
||||
data modify storage mq:main button_defs append value {n:"hint", x:2767, y:86, z:5968, f:"north", c:"function mq:commands/hint", label:"힌트"}
|
||||
data modify storage mq:main button_defs append value {n:"replay", x:2765, y:86, z:5968, f:"north", c:"function mq:commands/replay", label:"다시듣기"}
|
||||
data modify storage mq:main button_defs append value {n:"test", x:2769, y:87, z:5957, f:"south", c:"function mq:commands/test", label:"소리 테스트"}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
data modify storage mq:main title set value "음악퀴즈"
|
||||
|
||||
# 플레이어 접속 시 텔레포트 위치 (x y z, r=yaw, f=pitch)
|
||||
data modify storage mq:main spawn set value {x: 144, y: 61, z: -219, r: 180, f: 0}
|
||||
data modify storage mq:main spawn set value {x: 2769, y: 85, z: 5963, r: 0, f: 0}
|
||||
|
||||
# 음원 재생 — minecraft_launcher 리소스팩의 musicquiz:track_NN 사운드 이벤트
|
||||
# namespace — 리소스팩 네임스페이스 (기본 "musicquiz")
|
||||
@@ -17,6 +17,6 @@ data modify storage mq:main audio set value {namespace: "musicquiz", source: "pl
|
||||
# namespace — painting_variant 네임스페이스 (기본 "mq")
|
||||
# x,y,z — 페인팅 entity 좌표 (벽면 앞쪽 블록 위치)
|
||||
# facing — 페인팅이 바라보는 방향: south=0 / west=1 / north=2 / east=3
|
||||
data modify storage mq:main image set value {namespace: "mq", x: 144, y: 84, z: -261, facing: 0b}
|
||||
data modify storage mq:main image set value {namespace: "mq", x: 2775, y: 85, z: 5982, facing: 2b}
|
||||
|
||||
# 곡 개수 max_index 는 init/songs.mcfunction 의 길이로 자동 계산됨
|
||||
|
||||
@@ -4,56 +4,23 @@
|
||||
# 곡 순서가 리소스팩의 track_NN / cover_NN 인덱스와 1:1 매칭된다.
|
||||
# 예) {title:"Quiet Song", author:"...", alias:[...], volume:2.0}
|
||||
data modify storage mq:main songs set value []
|
||||
data modify storage mq:main songs append value {title:"Lose My Mind", author:"Don Toliver", alias:["루즈 마이 마인드","루스 마이 마인드","ㅣㅐㄴㄷ ㅡㅛ ㅡㅑㅜㅇ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"The Chase", author:"Hearts2Hearts", alias:["더 체이즈","더 체이스","솓 촘ㄴㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"HOT SAUCE", author:"BABYMONSTER", alias:["핫 소스","ㅙㅅ ㄴ면ㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Golden", author:"HUNTR/X", alias:["골든"," 해ㅣㅇ두"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"돌림판", author:"머쉬베놈", alias:["Spin the wheel"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"OVERDRIVE", author:"TWS", alias:["오버드라이브","ㅐㅍㄷㄱㅇ걒ㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"눈물참기", author:"QWER", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"깨어", author:"tripleS", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"like JENNIE", author:"제니", alias:["라이크 제니","라익 제니","라잌 제니","ㅣㅑㅏㄷ ㅓ두ㅜㅑㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Rich Man", author:"aespa", alias:["리치 맨","갸초 ㅡ무"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"I DO ME", author:"KiiiKiii", alias:["아이 두 미","아 두 미","ㅑ 애 ㅡㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"SIGN", author:"izna", alias:["사인","냐후"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"WICKED", author:"ALLDAY PROJECT", alias:["위키드","쟈찯ㅇ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Good Thing", author:"i-dle", alias:["굿 띵","굳 띵","해ㅐㅇ 소ㅑㅜㅎ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"0+0", author:"한로로", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"HANDS UP", author:"MEOVV", alias:["핸즈 업","핸스 업","ㅗ뭉ㄴ ㅕㅔ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Blue Valentine", author:"NMIXX", alias:["블루 발렌타인","ㅠㅣㅕㄷ ㅍ미두샤ㅜㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Flower", author:"오반", alias:["플라워","리ㅐㅈㄷㄱ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Soda Pop", author:"Saja Boys", alias:["소다 팝","냉ㅁ ㅔㅐㅔ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"REBEL HEART", author:"IVE", alias:["레블 하트","ㄱ듀디 ㅗㄷㅁㄳ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"GO!", author:"CORTIS", alias:["고","고!","GO","해","해!"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"BEEP", author:"izna", alias:["빕","삡","ㅠㄷ데"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Pookie", author:"FIFTY FIFTY", alias:["푸키","ㅔㅐㅐㅏㅑㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"DAISIES", author:"Justin Bieber", alias:["데이지즈","데이지스","ㅇ먀냗ㄴ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"빌려온 고양이", author:"ILLIT", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"TOO BAD", author:"OfficialGDRAGON", alias:["투 배드","투 밷","새ㅐ ㅠㅁㅇ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"시작의 아이", author:"마크툽", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"STYLE", author:"Hearts2Hearts", alias:["스타일","ㄴ쇼ㅣㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Good Goodbye", author:"화사", alias:["굿 굿바이","굳 굳바이","해ㅐㅇ 해ㅐ유ㅛㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"너에게 닿기를", author:"10CM", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"IRIS OUT", author:"Kenshi Yonezu", alias:["아이리스 아웃","이리스 아웃","ㅑ갼 ㅐㅕㅅ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Sugar On My Tongue", author:"Tyler, The Creator", alias:["슈가 온 마이 텅","슈가 온 마 텅","녛ㅁㄱ ㅐㅜ ㅡㅛ 새ㅜ혇"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Hollywood Action", author:"BOYNEXTDOOR", alias:["할리우드 액션","ㅙㅣㅣㅛ재ㅐㅇ ㅁㅊ샤ㅐㅜ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"SPAGHETTI", author:"LE SSERAFIM", alias:["스파게티","넴혿ㅅ시"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Gabriela", author:"KATSEYE", alias:["가브리엘라","ㅎ뮤갸딤"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"LIKE YOU BETTER", author:"프로미스나인", alias:["라이크 유 베터","라이크 유 베럴","라잌 유 베터","라잌 유 베럴","ㅣㅑㅏㄷ ㅛㅐㅕ ㅠㄷㅅㅅㄷㄱ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"뛰어", author:"BLACKPINK", alias:["jump"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"CHANEL", author:"Tyla", alias:["샤넬","초무디"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"오늘만 I LOVE YOU", author:"BOYNEXTDOOR", alias:["오늘만 아이 러브 유","오늘만 ㅑ ㅣㅐㅍㄷ ㅛㅐㅕ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"earthquake", author:"지수", alias:["어스퀘이크","얼스퀘이크","ㄷㅁㄱ소벼맏","보만다 지진"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"윽!", author:"염따", alias:["윽"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Abracadabra", author:"Lady Gaga", alias:["아브라카다브라","뮥ㅁㅊㅁㅇ뮥ㅁ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"멸종위기사랑", author:"이찬혁", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Dirty Work", author:"aespa", alias:["더티 워크","덜티 워크","더티 월크","덜티 월크","약쇼 재가"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"HOT", author:"LE SSERAFIM", alias:["핫","ㅙㅅ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"FAMOUS", author:"ALLDAY PROJECT", alias:["페이머스","ㄹ므ㅐㅕㄴ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"XOXZ", author:"IVE", alias:["엑스 오 엑스 지","엑스 오 엑스 제트","탵ㅋ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"여름이었다", author:"H1-KEY", alias:[], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"LOV3", author:"식케이", alias:["럽3","ㅣㅐㅍ3"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"Drive", author:"Ed Sheeran", alias:["드라이브","ㅇ걒ㄷ"], volume:1.0}
|
||||
data modify storage mq:main songs append value {title:"푸르던", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"금요일에 만나요", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"나의 옛날이야기", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"비밀의 화원", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"겨울잠", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"이런엔딩", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"이름에게", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"드라마", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"가을아침", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"Rain Drop", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"에필로그", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"무릎", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"마음", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"잠 못 드는 밤 비는 내리고", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"정거장", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"자장가", author:"아이유", alias:[]}
|
||||
data modify storage mq:main songs append value {title:"사랑이 지나가면", author:"아이유", alias:[]}
|
||||
|
||||
# 곡 개수는 songs 배열 길이에서 자동 계산됨
|
||||
execute store result storage mq:main max_index int 1 run data get storage mq:main songs
|
||||
|
||||
@@ -22,23 +22,21 @@ 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 초기화.)
|
||||
# same objective 안에 holder 두 종류 — `#server` 는 서버 컴포넌트 존재
|
||||
# (서버 측 모드가 매 tick 1 로 갱신), `<player>` 는 클라 측 존재 (payload
|
||||
# 수신 시 1 로 갱신).
|
||||
#
|
||||
# mq_chat_mod (mc_chat_answer_mod) 는 더 이상 게이트하지 않음 — 모드 없는
|
||||
# 환경에서도 `/trigger input` dialog 경로로 정답 제출 가능. presence pulse
|
||||
# 가 호스트 환경에 따라 안 들어오거나 사용자 모드 버전이 옛날일 때 false
|
||||
# negative 로 시작이 막히던 문제 회피. (모드 측은 여전히 매 tick objective
|
||||
# 존재시 1 로 set 시도하지만, objective 가 없으면 silent skip 하므로 무해.)
|
||||
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
|
||||
|
||||
9
music_quiz/data/mq/function/quiz/macro/summon.mcfunction
Normal file
9
music_quiz/data/mq/function/quiz/macro/summon.mcfunction
Normal file
@@ -0,0 +1,9 @@
|
||||
$execute unless data storage mq:main {answer:{title:"음악퀴즈"}} run summon minecraft:marker $(x) $(y) $(z) {Tags:["mq","default"],CustomName:"정답입력시작"}
|
||||
$summon minecraft:marker $(x) $(y) $(z) {Tags:["mq","default"],CustomName:"$(name)"}
|
||||
|
||||
execute store result score length func.temp run data get storage mq:tmp marker_call.alias
|
||||
execute if score length func.temp matches 1.. run data modify storage mq:tmp marker_call.name set from storage mq:tmp marker_call.alias[0]
|
||||
execute if score length func.temp matches 1.. run data remove storage mq:tmp marker_call.alias[0]
|
||||
execute if score length func.temp matches 1.. run function mq:quiz/macro/summon2 with storage mq:tmp marker_call
|
||||
|
||||
$execute unless data storage mq:main {answer:{title:"음악퀴즈"}} run summon minecraft:marker $(x) $(y) $(z) {Tags:["mq","default"],CustomName:"정답입력종료"}
|
||||
@@ -0,0 +1,6 @@
|
||||
$summon minecraft:marker $(x) $(y) $(z) {Tags:["mq","default"],CustomName:"$(name)"}
|
||||
|
||||
execute store result score length func.temp run data get storage mq:tmp marker_call.alias
|
||||
execute if score length func.temp matches 1.. run data modify storage mq:tmp marker_call.name set from storage mq:tmp marker_call.alias[0]
|
||||
execute if score length func.temp matches 1.. run data remove storage mq:tmp marker_call.alias[0]
|
||||
execute if score length func.temp matches 1.. run function mq:quiz/macro/summon2 with storage mq:tmp marker_call
|
||||
@@ -1,5 +1,7 @@
|
||||
scoreboard players set timer main 0
|
||||
|
||||
stopsound @a player
|
||||
|
||||
execute if score index main >= max_index main run return run function mq:quiz/end with storage mq:main
|
||||
|
||||
scoreboard players add index main 1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 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 점수 상태:
|
||||
@@ -26,15 +27,21 @@
|
||||
# 인접: 중심 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 에서 멈추게.
|
||||
# south : 깊이 z 중심 = -0.0625 (interaction z ∈ [-0.125, 0], 버튼 z ∈ [0, 0.125])
|
||||
# north : 깊이 z 중심 = 1.0625 (interaction z ∈ [1, 1.125], 버튼 z ∈ [0.875, 1])
|
||||
# east : 깊이 x 중심 = -0.0625
|
||||
# west : 깊이 x 중심 = 1.0625
|
||||
# 메이션이 같이 일어남. → 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 보정됨 (블록 중심으로 잡힘).
|
||||
@@ -42,52 +49,56 @@
|
||||
# 을 더하면 박스 전체가 0.5 칸 어긋남. $(x).0 $(y).0 $(z).0 처럼 decimal
|
||||
# 형태로 넘기면 보정 없이 정확한 블록 origin (minimal corner) 이 됨.
|
||||
#
|
||||
# ---- text_display 위치 (버튼 바로 아래 같은 벽면에 부착) ----
|
||||
# 같은 벽 (button 의 머리 normal 반대편 블록) 의 visible 면에 살짝 띄워
|
||||
# 부착. 텍스트 entity Y 는 텍스트 baseline 근방 → 아래 블록 바닥에 두면
|
||||
# 텍스트가 그 블록 안에 위로 솟아남.
|
||||
# south : ~0.5 ~-1 ~0.01 yaw 0 (head 가 +z 방향 → 벽 +z=0.01 살짝 띄움)
|
||||
# north : ~0.5 ~-1 ~0.99 yaw 180
|
||||
# east : ~0.01 ~-1 ~0.5 yaw -90
|
||||
# west : ~0.99 ~-1 ~0.5 yaw 90
|
||||
# ---- 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[type=minecraft:interaction,tag=mq,tag=$(n)]
|
||||
$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 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[type=minecraft:interaction,tag=mq,tag=$(n)]
|
||||
$execute if score $(n) buttons matches -1 run kill @e[type=minecraft:text_display,tag=mq,tag=$(n)]
|
||||
$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.0625, 블록 면 바깥), 가로축=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.375 ~0.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.625 ~0.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.01 {Tags:["mq","$(n)"],Rotation:[0f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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]}}
|
||||
# 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(+1.0625, 블록 면 바깥), 가로축=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.375 ~0.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.625 ~0.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.99 {Tags:["mq","$(n)"],Rotation:[180f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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.0625, 블록 면 바깥), 가로축=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.0625 ~0.375 ~0.375 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.0625 ~0.375 ~0.5 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.0625 ~0.375 ~0.625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.5 {Tags:["mq","$(n)"],Rotation:[-90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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(+1.0625, 블록 면 바깥), 가로축=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 ~1.0625 ~0.375 ~0.375 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~1.0625 ~0.375 ~0.5 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~1.0625 ~0.375 ~0.625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.5 {Tags:["mq","$(n)"],Rotation:[90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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
|
||||
|
||||
@@ -97,10 +108,10 @@ $execute if score $(n) buttons matches -1 run scoreboard players set $(n) button
|
||||
# 한 버튼에 interaction 3개지만 `on target` 은 클릭된 1개만 통과
|
||||
# (나머지는 target 부재로 체인 중단). limit=1 을 두면 MC 가 임의로 1개를
|
||||
# 골라 잘못된 entity 만 검사하므로 limit 두지 않음.
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] 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[type=minecraft:interaction,tag=mq,tag=$(n)] on target as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 0 run $(c)
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] on target as @s positioned $(x).0 $(y).0 $(z).0 unless score init main matches 0 run trigger $(n)
|
||||
$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[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s attack
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s interaction
|
||||
$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
|
||||
|
||||
@@ -6,44 +6,10 @@ execute unless score init main matches 2 \
|
||||
run scoreboard players set timer main 0
|
||||
|
||||
# start title timer
|
||||
execute if score init main matches 2 if score timer main matches 20 run title @a title {"text":"3"}
|
||||
execute if score init main matches 2 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 init main matches 2 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 init main matches 2 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 init main matches 2 if score timer main matches 40 run title @a title {"text":"2"}
|
||||
execute if score init main matches 2 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 init main matches 2 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 init main matches 2 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 init main matches 2 if score timer main matches 60 run title @a title {"text":"1"}
|
||||
execute if score init main matches 2 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 init main matches 2 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 init main matches 2 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 init main matches 2 if score timer main matches 100 run title @a title {"text":""}
|
||||
execute if score init main matches 2 if score timer main matches 100.. run function mq:quiz/select with storage mq:main
|
||||
execute if score init main matches 2 run function mq:repeat/timers/init2
|
||||
|
||||
# next song timer
|
||||
execute if score init main matches 6 if score timer main matches 300 run title @a title {"text":""}
|
||||
execute if score init main matches 6 if score timer main matches 290 run function mq:images/clear
|
||||
execute if score init main matches 6 if score timer main matches 300.. run function mq:quiz/select with storage mq:main
|
||||
execute if score init main matches 6 run function mq:repeat/timers/init6
|
||||
|
||||
# endding timer
|
||||
execute if score init main matches 10 if score timer main matches 60 run function mq:tellraw {"text":"퀴즈가 종료되었습니다.","color":"white","msg":""}
|
||||
execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 60 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
|
||||
execute if score init main matches 10 if score timer main matches 180 run function mq:tellraw {"text":"퀴즈를 다시 시작하시려면 종료를 눌러주세요.","color":"white","msg":""}
|
||||
execute if score init main matches 10 if score timer main matches 120 as @a at @s run scoreboard players set stop buttons -1
|
||||
execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 120 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
|
||||
execute if score init main matches 10 if score timer main matches 120 run function mq:tellraw {"text":"플레이 해주셔서 감사합니다.","color":"white","msg":""}
|
||||
execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
execute if score init main matches 10 if score timer main matches 180 as @a at @s run playsound minecraft:ui.button.click weather @s ~ ~ ~ 1 1
|
||||
|
||||
execute if score init main matches 10 if score timer main matches 200.. run scoreboard players set init main 11
|
||||
execute if score init main matches 10 run function mq:repeat/timers/init10
|
||||
|
||||
@@ -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
music_quiz/data/mq/function/repeat/timers/init2.mcfunction
Normal file
15
music_quiz/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
music_quiz/data/mq/function/repeat/timers/init6.mcfunction
Normal file
15
music_quiz/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
|
||||
@@ -1,3 +1,4 @@
|
||||
# warn-off execute-group
|
||||
execute if score init main matches 0..1 run scoreboard players enable @a ready
|
||||
execute if score init main matches 0..1 as @a if score @s ready matches 1 run function mq:tellraw {"text":"","color":"black",msg:[{"selector":"@s","color": "yellow","bold": true},{"text":" : ","color":"gray"},{"text":"준비완료","color":"white"}]}
|
||||
execute if score init main matches 0..1 as @a if score @s ready matches 1 run scoreboard players set @s ready 2
|
||||
|
||||
@@ -6,5 +6,6 @@ execute if score init main matches 2.. run function mq:repeat/timer
|
||||
execute if score init main matches 5..6 run function mq:repeat/check_answer
|
||||
|
||||
# 정답 입력 다이얼로그: init=5 (곡 재생 중) 일 때만 열림 / 제출 처리
|
||||
# warn-off execute-group
|
||||
execute if score init main matches 5 as @a[scores={input=1..}] run function mq:answer/open
|
||||
execute if score init main matches 5 run function mq:answer/process
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_01",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_01",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_02",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_02",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_03",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_03",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_04",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_04",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_05",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_05",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_06",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_06",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_07",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_07",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_08",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_08",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_09",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_09",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_10",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_10",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_11",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_11",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_12",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_12",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_13",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_13",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_14",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_14",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_15",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_15",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_16",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_16",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_17",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "cover_17",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_18",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_19",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_20",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_21",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_22",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_23",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_24",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_25",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_26",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_27",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_28",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_29",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_30",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_31",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_32",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_33",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_34",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_35",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_36",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_37",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_38",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_39",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_40",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_41",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_42",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_43",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_44",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_45",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_46",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_47",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_48",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_49",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"asset_id": "musicquiz:cover_50",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"asset_id": "musicquiz:gif",
|
||||
"width": 1,
|
||||
"height": 1
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"title": "gif",
|
||||
"author": "musicquiz"
|
||||
}
|
||||
|
||||
119
temp/README.md
119
temp/README.md
@@ -1,45 +1,61 @@
|
||||
# v1.0.21 → v1.0.22 부분 적용 가이드
|
||||
# 부분 적용 가이드 (→ v1.0.26)
|
||||
|
||||
전체 datapack 을 교체하지 않고, 이 폴더의 파일만 덮어쓰면 v1.0.22 와 동일한 상태가 됩니다.
|
||||
전체 datapack zip 을 새로 풀지 않고, 이 폴더의 파일만 같은 경로에
|
||||
덮어쓰면 v1.0.26 와 동일한 동작이 됩니다. 본인 월드 좌표·곡 목록 등이
|
||||
들어 있는 `init/*.mcfunction` 은 일부러 포함하지 않았습니다 — 덮어쓰면
|
||||
좌표가 날아가니까요.
|
||||
|
||||
## 무엇이 바뀌었나 (v1.0.22 신규)
|
||||
## v1.0.26 = v1.0.25 + 문서 정리
|
||||
|
||||
### `commands/start.mcfunction` + `load.mcfunction` — "채팅정답 모드 미설치" false negative 제거
|
||||
v1.0.26 자체에는 데이터팩 동작 변경이 없습니다. 변경 사항:
|
||||
- 삭제됐던 `docs/mc_video_player_mod_integration.md` 복구.
|
||||
- 루트 `README.md` 의 오류 정정:
|
||||
- 음원 채널 `weather` → 실제는 `player` (UI 비프만 `weather`) 로 정정.
|
||||
- 폐기된 `marker` 스토리지/엔티티 설명을 “legacy 정리용” 으로 정리.
|
||||
- `temp/` 부분 적용 패키지 v1.0.26 기준으로 복구 (이 폴더).
|
||||
|
||||
모드를 설치했는데도 `/start` 가 "채팅정답 모드가 서버에 미설치" 로 차단되던 문제.
|
||||
v1.0.25 의 데이터팩 코드를 이미 쓰고 있다면 mods · 데이터팩 변경 없이
|
||||
끝납니다. **이 폴더를 적용해야 하는 건 v1.0.25 이전 버전에서 올라오는
|
||||
경우** 입니다.
|
||||
|
||||
원인: 검증은 모드가 매 server tick `#server mq_chat_mod` 점수를 1 로 set
|
||||
하는지 보는 방식인데, 다음 케이스에서 score 가 1 로 안 올라가 false negative:
|
||||
- 사용자가 옛 모드 버전 (v1.3.4 이하, presence tick 추가 전) 을 쓰고 있을 때
|
||||
- banner/mohist 같은 fabric-bukkit 하이브리드 호스트에서 ServerTickEvents 가
|
||||
안 들어올 때
|
||||
## 같이 들어 있는 누적 fix (v1.0.19 ~ v1.0.25)
|
||||
|
||||
근본 수정: 채팅정답 모드는 입력을 편하게 만들어 주는 **선택적 편의 기능**일
|
||||
뿐, 모드 없이도 `/trigger input` dialog 경로로 정답 제출 가능. 그래서 채팅
|
||||
모드 게이트 자체를 제거. 영상재생 모드 (mc_video_player_mod) 게이트는 진짜
|
||||
필수이므로 유지.
|
||||
### 버튼 인프라 (`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`), 셀렉터 정렬 통일.
|
||||
|
||||
## 이전 버전 fix 도 같이 포함 (v1.0.20, v1.0.21)
|
||||
### 모드 게이트 (`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/buttons/btn.mcfunction`
|
||||
- (v1.0.20) `positioned $(x) $(y) $(z)` → `$(x).0 $(y).0 $(z).0`.
|
||||
MC vec3 정수 인자의 +0.5 보정 (블록 중심) 으로 interaction 박스가 0.5 칸
|
||||
어긋나던 문제 회피.
|
||||
- (v1.0.21) interaction 깊이축을 stone_button hitbox 바깥쪽으로 한 두께만큼
|
||||
이동. 한 번 클릭에 stone_button 도 같이 눌리던 (powered=true) 문제 회피.
|
||||
- (v1.0.21) `text_display.text` 를 String JSON 에서 직접 TextComponent
|
||||
compound 로. MC 1.20.5+ 부터 라벨이 `{"text":"게임시작",...}` 코드 그대로
|
||||
렌더되던 문제 회피.
|
||||
|
||||
### `repeat/buttons/btn_prep.mcfunction`
|
||||
- (v1.0.20) `execute unless data storage mq:tmp btn.label ...` 가 MC 26.1.2
|
||||
파서에 거부되던 문제. defaults + `data modify ... merge from` 방식으로
|
||||
재작성.
|
||||
### 타이머 분할 (`repeat/timer.mcfunction` + `repeat/timers/`)
|
||||
- v1.0.25: 큰 `timer.mcfunction` 을 init 단계별 (`init2` 카운트다운,
|
||||
`init6` 다음 곡, `init10` 엔딩) 서브함수로 분할. `timer.mcfunction` 은
|
||||
init 게이팅만 하고 각 서브를 호출.
|
||||
|
||||
## 적용 방법
|
||||
|
||||
서버의 datapack 폴더 (예: `world/datapacks/music_quiz/`) 기준으로 이 폴더의
|
||||
파일을 **같은 경로에 덮어쓰세요**.
|
||||
### 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
|
||||
@@ -50,16 +66,36 @@ temp/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
|
||||
```
|
||||
|
||||
이미 v1.0.21 을 적용한 상태라면 위 두 `repeat/buttons/*` 파일은 동일하므로
|
||||
사실상 `start.mcfunction` 과 `load.mcfunction` 두 개만 새로 바뀝니다.
|
||||
그래도 4 개 모두 덮어쓰는 게 안전합니다 (idempotent).
|
||||
`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
|
||||
@@ -67,8 +103,9 @@ temp/data/mq/function/repeat/buttons/btn_prep.mcfunction
|
||||
|
||||
## 확인
|
||||
|
||||
- 채팅정답 모드가 설치되어 있든 아니든 `/start` 가 "채팅정답 모드 미설치"
|
||||
메시지로 차단되지 않아야 합니다. (영상재생 모드는 여전히 필수.)
|
||||
- 버튼 클릭 시 stone_button 의 powered 애니메이션 없음.
|
||||
- 라벨이 `게임시작` 등으로 정상 표시 (JSON 코드 노출 없음).
|
||||
- 콘솔에 파싱 에러 없음.
|
||||
- 콘솔에 `btn_prep` / `btn` 파싱 에러 없음.
|
||||
- 버튼 클릭 시 stone_button powered 애니메이션 발생하지 않음
|
||||
(interaction 박스가 한 두께 바깥에서 ray 를 가로채므로).
|
||||
- 라벨이 버튼 바로 아래 벽면에 굵게 표시.
|
||||
- 채팅정답 / 영상재생 모드 미설치 시 `/start` 가 사유 메시지와 함께 차단.
|
||||
- 모드 둘 다 정상 설치되어 있으면 `/start` 정상 진행.
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
execute if score init main matches 10 run return run function mq:tellraw {"text":"퀴즈가 완전히 종료된후 시작해주세요.","color":"red","msg":""}
|
||||
|
||||
# ---- 외부 모드 설치 검증 ----
|
||||
# mq_video_mod (mc_video_player_mod) 만 게이트. 영상 렌더링은 클라 모드가
|
||||
# 필수라 없으면 게임이 의미가 없음. same objective 안에 holder 두 종류:
|
||||
# 두 모드는 성격이 달라서 검증 방식이 다름:
|
||||
#
|
||||
# * 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 유지.
|
||||
# 이렇게 분리해야 "서버 미설치"와 "특정 플레이어 클라 미설치"가 안내에서
|
||||
# 구분된다.
|
||||
#
|
||||
# mq_chat_mod (mc_chat_answer_mod) 는 게이트하지 않음 — 채팅 모드는 입력을
|
||||
# "편하게" 만들어주는 옵션일 뿐이고, 모드 없는 환경에서도 `/trigger input`
|
||||
# dialog 경로로 정답 제출이 가능. 과거에 게이트해 두면 모드 presence pulse
|
||||
# 가 호스트 환경 (banner/mohist 같은 fabric-bukkit 하이브리드) 에서 안
|
||||
# 들어오거나, 사용자 모드 버전이 presence tick 이전 (v1.3.4 이하) 일 때
|
||||
# false negative 로 시작이 막혔음.
|
||||
#
|
||||
# 1) 서버 측 영상 모드 부재 — 전원 차단, 단일 안내.
|
||||
# 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) 부재 — 본인 누락 안내 + 차단.
|
||||
|
||||
@@ -22,23 +22,21 @@ 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 초기화.)
|
||||
# same objective 안에 holder 두 종류 — `#server` 는 서버 컴포넌트 존재
|
||||
# (서버 측 모드가 매 tick 1 로 갱신), `<player>` 는 클라 측 존재 (payload
|
||||
# 수신 시 1 로 갱신).
|
||||
#
|
||||
# mq_chat_mod (mc_chat_answer_mod) 는 더 이상 게이트하지 않음 — 모드 없는
|
||||
# 환경에서도 `/trigger input` dialog 경로로 정답 제출 가능. presence pulse
|
||||
# 가 호스트 환경에 따라 안 들어오거나 사용자 모드 버전이 옛날일 때 false
|
||||
# negative 로 시작이 막히던 문제 회피. (모드 측은 여전히 매 tick objective
|
||||
# 존재시 1 로 set 시도하지만, objective 가 없으면 silent skip 하므로 무해.)
|
||||
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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 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 점수 상태:
|
||||
@@ -26,15 +27,21 @@
|
||||
# 인접: 중심 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 에서 멈추게.
|
||||
# south : 깊이 z 중심 = -0.0625 (interaction z ∈ [-0.125, 0], 버튼 z ∈ [0, 0.125])
|
||||
# north : 깊이 z 중심 = 1.0625 (interaction z ∈ [1, 1.125], 버튼 z ∈ [0.875, 1])
|
||||
# east : 깊이 x 중심 = -0.0625
|
||||
# west : 깊이 x 중심 = 1.0625
|
||||
# 메이션이 같이 일어남. → 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 보정됨 (블록 중심으로 잡힘).
|
||||
@@ -42,52 +49,56 @@
|
||||
# 을 더하면 박스 전체가 0.5 칸 어긋남. $(x).0 $(y).0 $(z).0 처럼 decimal
|
||||
# 형태로 넘기면 보정 없이 정확한 블록 origin (minimal corner) 이 됨.
|
||||
#
|
||||
# ---- text_display 위치 (버튼 바로 아래 같은 벽면에 부착) ----
|
||||
# 같은 벽 (button 의 머리 normal 반대편 블록) 의 visible 면에 살짝 띄워
|
||||
# 부착. 텍스트 entity Y 는 텍스트 baseline 근방 → 아래 블록 바닥에 두면
|
||||
# 텍스트가 그 블록 안에 위로 솟아남.
|
||||
# south : ~0.5 ~-1 ~0.01 yaw 0 (head 가 +z 방향 → 벽 +z=0.01 살짝 띄움)
|
||||
# north : ~0.5 ~-1 ~0.99 yaw 180
|
||||
# east : ~0.01 ~-1 ~0.5 yaw -90
|
||||
# west : ~0.99 ~-1 ~0.5 yaw 90
|
||||
# ---- 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[type=minecraft:interaction,tag=mq,tag=$(n)]
|
||||
$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 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[type=minecraft:interaction,tag=mq,tag=$(n)]
|
||||
$execute if score $(n) buttons matches -1 run kill @e[type=minecraft:text_display,tag=mq,tag=$(n)]
|
||||
$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.0625, 블록 면 바깥), 가로축=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.375 ~0.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.625 ~0.375 ~-0.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.01 {Tags:["mq","$(n)"],Rotation:[0f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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]}}
|
||||
# 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(+1.0625, 블록 면 바깥), 가로축=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.375 ~0.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.625 ~0.375 ~1.0625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.99 {Tags:["mq","$(n)"],Rotation:[180f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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.0625, 블록 면 바깥), 가로축=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.0625 ~0.375 ~0.375 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.0625 ~0.375 ~0.5 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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.0625 ~0.375 ~0.625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.5 {Tags:["mq","$(n)"],Rotation:[-90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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(+1.0625, 블록 면 바깥), 가로축=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 ~1.0625 ~0.375 ~0.375 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~1.0625 ~0.375 ~0.5 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~1.0625 ~0.375 ~0.625 {Tags:["mq","$(n)"],width:0.125f,height:0.25f,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 ~-1 ~0.5 {Tags:["mq","$(n)"],Rotation:[90f,0f],background:0,text:{text:"$(label)",color:"$(label_color)",font:"$(label_font)"},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
|
||||
|
||||
@@ -97,10 +108,10 @@ $execute if score $(n) buttons matches -1 run scoreboard players set $(n) button
|
||||
# 한 버튼에 interaction 3개지만 `on target` 은 클릭된 1개만 통과
|
||||
# (나머지는 target 부재로 체인 중단). limit=1 을 두면 MC 가 임의로 1개를
|
||||
# 골라 잘못된 entity 만 검사하므로 limit 두지 않음.
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] 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[type=minecraft:interaction,tag=mq,tag=$(n)] on target as @s positioned $(x).0 $(y).0 $(z).0 if score init main matches 0 run $(c)
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] on target as @s positioned $(x).0 $(y).0 $(z).0 unless score init main matches 0 run trigger $(n)
|
||||
$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[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s attack
|
||||
$execute as @e[type=minecraft:interaction,tag=mq,tag=$(n)] at @s run data remove entity @s interaction
|
||||
$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
|
||||
|
||||
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
|
||||
BIN
temp/gif.png
Normal file
BIN
temp/gif.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
6
temp/gif.png.mcmeta
Normal file
6
temp/gif.png.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"interpolate": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user