Files
2026-10-26 20:50:00 -04:00

131 lines
5.2 KiB
Markdown

# Stream Chat
A client-side Fabric mod that displays Twitch, YouTube, and TikTok live-stream
events in Minecraft. Twitch and YouTube events are received from Streamer.bot;
TikTok events are received from TikFinity.
## Supported Minecraft versions
Each version has its own jar (`stream-chat-<minecraft version>-<mod version>.jar`);
pick the one that matches your game.
| Minecraft | Fabric Loader | Fabric API | Mod Menu | Java |
|-----------|---------------|------------|----------|------|
| 26.1.2 | 0.20.1+ | 0.155.3+26.1.2 | 18.0.2 | 25 |
| 1.20.1 | 0.15.11+ | 0.92.2+1.20.1 | 7.2.2 | 17 |
## Initial setup
1. Install Fabric Loader and Fabric API for your Minecraft version (see table).
2. Install Mod Menu to open the mod's settings screen from the Mods menu.
3. Configure the Streamer.bot and TikFinity WebSocket addresses in
`config/stream-chat/stream-chat.json` or in the in-game settings.
4. Start Streamer.bot/TikFinity and launch Minecraft. Enabled integrations
connect automatically; use the configured keybind or settings screen to
toggle them.
The Streamer.bot password, when configured, is stored as plain text in the
local Minecraft config file. Do not share that file or diagnostic logs without
checking them for private information.
The mod is client-only. It does not send stream events or chat messages to the
Minecraft server.
## Configuration
All files live in `config/stream-chat/`:
| File | Contents |
|------|----------|
| `stream-chat.json` | Platform and integration on/off, WebSocket URLs, event destinations (chat, action bar, toast, hidden), emote replacements |
| `twitch.yml`, `youtube.yml`, `tiktok.yml` | Message formatting for that platform |
Each platform file has a `prefix`, a fallback `format`, and an `events:` section
with the message format for every event. They are written with defaults the
first time the mod runs. Per-event formats are edited only in the file; the
settings menu edits the prefix and the chat-message format. For example, in
`tiktok.yml`:
```yaml
prefix: "&#FE2C55[TikTok]&r"
events:
chat: "{prefix} | {username} > {message}"
join: "&e@{username} joined"
like: "{prefix}{username} sent {data.likeCount} likes"
```
The default prefix is just the platform tag (e.g. `[Twitch]`) and the default
chat-message format is `{prefix} | {username} > {message}`. Pressing Done in the
settings menu saves the prefix and chat format to these files, and the menu
reads them back each time it opens. An unclosed placeholder such as `{message`
is closed automatically.
Delete an `events:` line to restore that event's default. Every event is shown
in chat by default; change where each one goes (chat, action bar, toast, hidden)
in the settings menu.
### Placeholders
`{prefix}`, `{platform}`, `{event}`, `{username}`, `{message}`, and
`{data.<field>}`, which reads any field from the platform's event (for example
`{data.likeCount}`, `{data.repeatCount}`, `{data.bits}`). A missing field is blank.
### Color codes
Prefixes and formats support `&` color codes, so each platform can have its own color:
| Code | Effect |
|------|--------|
| `&0`-`&9`, `&a`-`&f` | Minecraft colors |
| `&#RRGGBB` | Any hex color, e.g. `&#9146FF` |
| `&l` `&o` `&n` `&m` `&k` | Bold, italic, underline, strikethrough, obfuscated |
| `&r` | Reset |
| `&&` | A literal `&` |
Text sent by viewers (usernames and messages) is never interpreted as color codes.
### Username color
Each platform file has a `username_color` setting that colors only the viewer's
name on that platform, leaving the message text alone. It takes the same codes as
above:
```yaml
username_color: "&#9146FF" # purple Twitch names
```
Leave it empty for no color. It applies to every event that uses `{username}`.
### Troubleshooting events
If events from a platform don't appear, set `"debugLogging": true` in
`stream-chat.json` and reload. Every raw message received from Streamer.bot or
TikFinity is then written to the game log (`logs/latest.log`), which shows the
exact event names and fields being sent. TikFinity's `config` message (its list
of configured actions) is not a viewer event and is ignored.
### Reloading
Changes to the files are not picked up while the game runs. Press **Reload
config** in the settings menu, or bind the **Reload Stream Chat Config** key in
Minecraft's controls, to re-read everything. Unsaved edits in the settings menu
are discarded by a reload, and saving the menu rewrites the files.
An existing `config/stream-chat.json` from an earlier version is migrated
automatically and kept as `stream-chat.json.bak`.
## Development
Run Gradle with a Java 25+ JVM (Java 17 targets are compiled with
`--release 17`). Build every supported version, one jar each, into `dist/`:
```text
powershell -File build-all.ps1
```
Each supported version is defined by `versions/<minecraft version>.properties`
(Minecraft, Fabric Loader, Fabric API, Mod Menu, and Java versions). To build a
single version, pass its properties as Gradle options, e.g.
`gradlew build -Pminecraft_version=1.20.1 -Ploader_version=0.15.11 -Pfabric_api_version=0.92.2+1.20.1 -Pmodmenu_version=7.2.2 -Pjava_version=17`.
To add a version, add a properties file; versions starting with `26.` use the
`src/versions/modern` sources, all others use `src/versions/legacy`.