SLChannelPointMod
一个 Minecraft Fabric 模组,将 Twitch 频道积分兑换与游戏内动作集成在一起。当观众在你的 Twitch 直播中兑换频道积分时,该模组会自动触发 Minecraft 世界中的相应动作。
功能特性
- Twitch 集成 - 连接至 Twitch EventSub 以接收实时的频道积分兑换通知
- 简易 GUI 配置 - 所有设置均可通过直观的内置菜单完成
- 多种动作类型:
- 生成生物 - 在玩家附近生成任意生物
- 随机生物 - 从可配置的池中生成随机生物
- 给予物品 - 向玩家给予物品
- 随机物品 - 向玩家给予随机物品
- 施加效果 - 对玩家施加药水效果
- 随机效果 - 从可配置的池中施加随机效果
- 播放声音 - 播放音量与音调可调的任何音效
- 执行命令 - 使用占位符执行任意服务器命令
- 特殊动作 - 随机打乱物品栏、丢弃手持物品、丢弃整个物品栏
- 从 Twitch 同步 - 导入你 Twitch 频道上现有的频道积分奖励
- 发布到 Twitch - 直接从模组创建新的频道积分奖励
- 屏幕 HUD 显示 - 实时查看兑换情况,支持自定义位置和缩放比例
- 持久化配置 - 奖励配置会被保存并在服务器重启后保持有效
依赖要求
- Minecraft 1.21.10~~~~
- Fabric Loader 0.18.1+
- Fabric API
- Java 21+
安装步骤
- 安装 Fabric Loader
- 下载 Fabric API
- 下载 SLChannelPointMod 的最新版本
- 将所有模组放入你的
mods 文件夹中
设置指南
1. 打开配置 GUI
(UI 基于 GUI 3 设计,其他设置下可能会存在兼容性问题。)
有两种方式打开配置界面:
- 在游戏中按 K(默认快捷键)
- 在聊天栏输入
/channelpoints
2. 登录 Twitch
- 进入 Settings(设置)选项卡
- 展开 Twitch Connection(Twitch 连接)部分
- 点击 Login with Twitch(使用 Twitch 登录)
- 浏览器窗口将弹出——请授权该应用程序
- 验证完成后返回游戏
3. 连接 Twitch
登录后,点击 Connect(连接)以开始接收频道积分兑换通知。
4. 配置奖励
选项 A:从 Twitch 同步现有奖励
- 进入 Rewards(奖励)选项卡
- 点击 Sync from Twitch(从 Twitch 同步)以导入你现有的频道积分奖励
- 选择一个奖励并点击 Edit(编辑)以配置其触发的动作
选项 B:创建新奖励
- 点击 + Add Reward(添加奖励)以创建新奖励
- 输入名称、消耗积分数量,并配置动作
- 点击 Save(保存)
- 可选:点击 Publish(发布)以在你的 Twitch 频道上创建该奖励
至此已完成设置!当观众兑换频道积分时,配置好的动作将在游戏内触发。
动作类型详解
Spawn Mob(生成生物)
在随机玩家附近生成生物。
- 使用浏览按钮选择生物类型
- 设置生成数量(或使用随机范围)
Random Mob (Same/Each)(随机生物:相同/逐个)
从已配置的生物池中生成随机生物。
- Same(相同):生成的所有生物均为同一种随机类型
- Each(逐个):每种生物独立随机选择
- 可为每个奖励配置自定义生物池,或使用默认的敌对/被动生物列表
Give Item(给予物品)
向随机玩家给予物品。
Random Item (Same/Each)(随机物品:相同/逐个)
从所有可用物品中向玩家给予随机物品。
- Same(相同):给予的所有物品均为同一种随机类型
- Each(逐个):每个物品独立随机选择
Apply Effect(施加效果)
对玩家施加药水效果。
- 使用浏览按钮选择效果
- 设置等级(1 = Level I,2 = Level II,以此类推)
- 设置持续秒数
Random Effect(随机效果)
从可配置的效果池中施加随机药水效果。
- 使用预设(有害、有益)或自定义选择来配置效果池
- 设置等级和持续时间
Play Sound(播放声音)
在玩家位置播放音效。
- 从所有 Minecraft 音效中选择,并提供预览按钮
- 调整音量(0.0 - 1.0)和音调(0.5 - 2.0)
Execute Command(执行命令)
运行支持占位符的服务器命令。
{player} - 替换为目标玩家的名称
{redeemer} - 替换为进行兑换的 Twitch 用户名
{random:min:max} - 替换为指定范围内的随机数
示例:say {redeemer} says hello to {player}!
示例:tp {player} ~ ~{random:5:20} ~
Special Actions(特殊动作)
预配置的特殊动作:
- Shuffle Inventory(随机打乱物品栏) - 随机打乱玩家物品栏中的所有物品
- Drop Held Item(丢弃手持物品) - 丢弃玩家当前手持的物品
- Drop Inventory(丢弃全部物品) - 丢弃玩家整个物品栏中的物品
HUD 设置
模组会在奖励被兑换时在屏幕上显示通知。可在 Settings > HUD Settings(设置 > HUD 设置)中进行自定义:
- Position(位置) - 左上、右上、左下或右下
- Max Messages(最大消息数) - 同时显示的兑换通知数量(1-10)
- Scale(缩放) - HUD 文本的大小(0.5x - 2.0x)
配置文件
配置文件存储在 .minecraft/config/slchannelpointmod.json 中,包含:
- Twitch 认证令牌
- 频道信息
- 已配置的奖励及其对应动作
- HUD 设置
- 随机生物池
权限说明
模组需要以下 Twitch 权限(在登录时请求):
channel:read:redemptions - 用于接收频道积分兑换事件
channel:manage:redemptions - 用于创建和删除频道积分奖励
故障排除
无法登录 / 浏览器未打开
从聊天/日志中复制 URL,并在浏览器中手动打开。
奖励未触发
- 确认已连接(检查设置中的 Twitch 连接状态)
- 确保奖励已配置了动作(未显示为红色/未配置状态)
- 尝试断开连接并重新连接
令牌过期
前往 Settings > Twitch Connection(设置 > Twitch 连接),然后点击 Re-login(重新登录)。
从源码构建
git clone https://github.com/andrewccard/SLChannelPointMod.git
cd SLChannelPointMod
./gradlew build
构建后的 JAR 文件位于 build/libs/ 目录中。
许可证
CC0-1.0
SLChannelPointMod
A Minecraft Fabric mod that integrates Twitch channel point redemptions with in-game actions. When viewers redeem channel points on your Twitch stream, the mod automatically triggers actions in your Minecraft world.
Features
- Twitch Integration - Connects to Twitch EventSub to receive real-time channel point redemptions
- Easy GUI Configuration - All setup done through an intuitive in-game menu
- Multiple Action Types:
- Spawn Mobs - Spawn any mob near the player
- Random Mobs - Spawn random mobs from a configurable pool
- Give Items - Give items to the player
- Random Items - Give random items to the player
- Apply Effects - Apply potion effects to the player
- Random Effects - Apply random effects from a configurable pool
- Play Sounds - Play any sound effect with adjustable volume and pitch
- Run Commands - Execute any server command with placeholders
- Special Actions - Shuffle inventory, drop held item, drop entire inventory
- Sync from Twitch - Import existing channel point rewards from your Twitch channel
- Publish to Twitch - Create new channel point rewards directly from the mod
- On-Screen HUD - See redemptions as they happen with customizable position and scale
- Persistent Config - Rewards are saved and persist across server restarts
Requirements
- Minecraft 1.21.10~~~~
- Fabric Loader 0.18.1+
- Fabric API
- Java 21+
Installation
- Install Fabric Loader
- Download Fabric API
- Download the latest release of SLChannelPointMod
- Place all mods in your
mods folder
Setup
1. Open the Configuration GUI
(UI was designed on GUI 3 so might be broken with other settings.)
There are two ways to open the configuration GUI:
- Press K (default keybind) while in-game
- Type
/channelpoints in chat
2. Login to Twitch
- Go to the Settings tab
- Expand Twitch Connection
- Click Login with Twitch
- A browser window will open - authorize the application
- Return to the game once authenticated
3. Connect to Twitch
After logging in, click Connect to start receiving channel point redemptions.
4. Configure Rewards
Option A: Sync existing rewards from Twitch
- Go to the Rewards tab
- Click Sync from Twitch to import your existing channel point rewards
- Select a reward and click Edit to configure what action it triggers
Option B: Create new rewards
- Click + Add Reward to create a new reward
- Enter a name, cost, and configure the action
- Click Save
- Optionally click Publish to create the reward on your Twitch channel
That's it! When viewers redeem channel points, the configured actions will trigger in-game.
Action Types
Spawn Mob
Spawns mobs near a random player.
- Select the mob type using the browse button
- Set the count (or use random range)
Random Mob (Same/Each)
Spawns random mobs from the configured mob pool.
- Same: All spawned mobs are the same random type
- Each: Each mob is randomly selected individually
- Configure a custom mob pool per reward or use the default hostile/passive lists
Give Item
Gives items to a random player.
- Select the item using the browse button
- Set the quantity
Random Item (Same/Each)
Gives random items to the player from all available items.
- Same: All items given are the same random type
- Each: Each item is randomly selected individually
Apply Effect
Applies a potion effect to the player.
- Select the effect using the browse button
- Set the level (1 = Level I, 2 = Level II, etc.)
- Set the duration in seconds
Random Effect
Applies a random potion effect from a configurable pool.
- Configure effect pool with presets (harmful, beneficial) or custom selection
- Set the level and duration
Play Sound
Plays a sound effect at the player's location.
- Select from all Minecraft sounds with a preview button
- Adjust volume (0.0 - 1.0) and pitch (0.5 - 2.0)
Execute Command
Runs a server command with placeholder support.
{player} - Replaced with the target player's name
{redeemer} - Replaced with the Twitch username who redeemed
{random:min:max} - Replaced with a random number in the range
Example: say {redeemer} says hello to {player}!
Example: tp {player} ~ ~{random:5:20} ~
Special Actions
Pre-configured special actions:
- Shuffle Inventory - Randomizes all items in the player's inventory
- Drop Held Item - Drops the item the player is currently holding
- Drop Inventory - Drops the player's entire inventory
HUD Settings
The mod displays on-screen notifications when rewards are redeemed. Customize in Settings > HUD Settings:
- Position - Top-left, top-right, bottom-left, or bottom-right
- Max Messages - How many redemptions to show at once (1-10)
- Scale - Size of the HUD text (0.5x - 2.0x)
Configuration
Config is stored in .minecraft/config/slchannelpointmod.json and includes:
- Twitch authentication tokens
- Channel information
- Configured rewards and their actions
- HUD settings
- Random mob pool
Permissions
The mod requires these Twitch permissions (requested during login):
channel:read:redemptions - To receive channel point redemption events
channel:manage:redemptions - To create and delete channel point rewards
Troubleshooting
Can't login / Browser doesn't open
Copy the URL from the chat/logs and open it manually in your browser.
Rewards not triggering
- Verify you're connected (check the Twitch Connection status in Settings)
- Make sure the reward has an action configured (not showing as red/unconfigured)
- Try disconnecting and reconnecting
Token expired
Go to Settings > Twitch Connection and click Re-login.
Building from Source
git clone https://github.com/andrewccard/SLChannelPointMod.git
cd SLChannelPointMod
./gradlew build
The built JAR will be in build/libs/.
License
CC0-1.0
评论 0
登录后参与评分
还没有评论,来抢沙发吧