Initial Fabric mod for chat-based quiz answer submission
Hooks ServerMessageEvents.ALLOW_CHAT_MESSAGE to intercept chat while the music_quiz datapack is in answer-accepting state (init=5 on objective 'main'). Intercepted messages are forwarded to mq:answer/submit with the player's UUID context and the chat broadcast is suppressed so the answer stays hidden from other players. Outside that state chat passes through normally. Target: Minecraft 1.21.6+, Java 21, Fabric Loader 0.16+, Fabric API. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
49
README.md
Normal file
49
README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# chat_answer (채팅정답)
|
||||
|
||||
음악퀴즈(`mq`) 데이터팩의 짝이 되는 **서버사이드** 모드.
|
||||
|
||||
정답 입력을 받는 상태(`scoreboard players get init main == 5`) 동안 플레이어가
|
||||
채팅을 입력하면 메시지를 가로채서 다음을 실행한다:
|
||||
|
||||
```
|
||||
execute as <플레이어 UUID> run function mq:answer/submit {text:'<채팅 내용>'}
|
||||
```
|
||||
|
||||
채팅은 다른 플레이어에게 broadcast 되지 않으므로 정답이 화면에 노출되지 않는다.
|
||||
`init` 점수가 5 가 아닐 때는 채팅이 평소처럼 모두에게 보인다.
|
||||
|
||||
## 빌드
|
||||
|
||||
JDK 21 필요. Linux/macOS:
|
||||
|
||||
```
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
Windows:
|
||||
|
||||
```
|
||||
gradlew.bat build
|
||||
```
|
||||
|
||||
산출물: `build/libs/chat_answer-<version>.jar`
|
||||
|
||||
## 설치
|
||||
|
||||
서버의 `mods/` 폴더에 jar 를 넣는다. Fabric Loader 0.16+ 필요. Fabric API 도 함께 설치.
|
||||
|
||||
## 호환성
|
||||
|
||||
- 빌드 대상: Minecraft 1.21.6 (Dialog 시스템 최초 버전).
|
||||
- 코드가 사용하는 API (`ServerMessageEvents.ALLOW_CHAT_MESSAGE`, `Scoreboard`, `MinecraftServer.getCommandManager`) 는 1.21.x 전반에 걸쳐 인터미디어리 매핑이 안정적이므로 동일 jar 가 그 이상 버전에서도 일반적으로 작동.
|
||||
- Mojang 이 chat / scoreboard / command 시스템을 깨는 변경을 적용하면 그 시점에 재빌드 필요.
|
||||
|
||||
### Forge / NeoForge 사용자
|
||||
|
||||
현재 jar 는 Fabric 전용. NeoForge 서버에서 사용하려면 [Sinytra Connector](https://modrinth.com/mod/connector) 를 함께 설치하면 그대로 작동.
|
||||
|
||||
(별도 NeoForge 네이티브 variant 빌드는 향후 추가 예정.)
|
||||
|
||||
## 라이센스
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user