English | ภาษาไทย
NamLivechat
弥合直播与 Minecraft 服务器之间的鸿沟。NamLivechat 是一款功能强大、高度可配置的插件,可将您的 YouTube、Twitch 和 TikTok 直播聊天室直接接入游戏。无需切换屏幕,即可通过实时消息和丰富的自定义警报系统保持社区互动。该插件专为性能和稳定性而构建,完全支持现代的 Folia 和 Paper 服务器。
工作原理(核心概念)
该插件使用不同的方法连接各个平台,以确保最稳定且高效的连接:
- YouTube: 通过官方 Google YouTube Data API v3 轮询以获取直播聊天消息和事件。
- Twitch: 连接到 Twitch 的实时 IRC 聊天服务器以实现即时消息传递,并使用 Helix API 监控新关注者等事件。
- TikTok: 使用
TikTokLiveJava 库连接到 TikTok 的非官方 Webcast 服务,模拟网页浏览器以接收评论和礼物等实时事件。
✨ 特性
- 多平台支持: 连接 YouTube、Twitch 和 TikTok 直播流。
- 实时聊天: 直接在 Minecraft 中显示直播聊天消息,并根据各平台中的角色对用户名进行着色。
- 全面的事件警报: 为所有重要事件获得即时、高度可定制的游戏内通知:
- YouTube: Super Chat、Super Stickers、新成员、赠送会员资格以及会员里程碑。
- Twitch: 新关注、订阅(首次订阅、续费)、赠送订阅和社区礼物炸弹。
- TikTok: 新关注和礼物。
- 高级警报系统: 警报以三种可配置的方式显示:
- 自定义聊天消息: 为每个事件设计独特的警报消息。
- 可配置声音: 为每个警报分配特定的声音、音量和音调。
- 动态 Boss 栏: 重要警报会出现在 Boss 栏上,立即替换之前的任何警报以显示最新事件。
- 完全自定义: 几乎所有方面都可通过 YAML 文件进行配置,包括消息格式、角色颜色、声音和 Boss 栏样式。
- 多语言支持: 所有面向用户的插件消息均可翻译。默认提供 英文 (
en.yml) 和 泰文 (th.yml) 文件。
- 半自动更新:
- 更新检查器: 自动从 GitHub 检查新版本,并在管理员加入时通知他们。
- 更新命令: 一个简单的命令 (
/namlivechat update) 将最新版本下载到服务器的主 update 文件夹中,以便在下一次服务器重启时安全地自动更新。
- 调试模式: 在
config.yml 中有一个简单的开关,用于显示详细的控制台日志,便于轻松排查问题。
⚙️ 兼容性
- 服务器软件: PaperMC & Folia (100% 兼容)。
- Minecraft 版本: 1.21+
? 安装与首次设置
- 从 Releases 页面下载最新的
.jar 文件。
- 将
NamLivechat-X.X.jar 文件放入服务器的 plugins 文件夹中。
- 启动服务器一次。插件将生成以下文件和文件夹:
plugins/NamLivechat/config.yml
plugins/NamLivechat/youtube-config.yml
plugins/NamLivechat/twitch-config.yml
plugins/NamLivechat/tiktok-config.yml
plugins/NamLivechat/messages/en.yml
plugins/NamLivechat/messages/th.yml
- 停止服务器。
- 按照下面的 API 和令牌设置 指南配置
youtube-config.yml 和 twitch-config.yml 文件。
- 再次启动服务器并享受吧!
? 配置
config.yml (主要配置)
此文件控制插件的全局设置。
# ========================================= #
# NamLivechat General Settings #
# ========================================= #
# 设置游戏内消息的语言。
# 可用语言由 'messages' 文件夹中的 .yml 文件定义。
language: "en"
# 设置为 true 以启用详细的控制台日志用于调试目的。
# 建议在正常使用期间将其保持为 false。
debug-mode: false
# ========================================= #
# Update Settings #
# ========================================= #
# 设置为 true 以在新版本可用时在游戏内通知管理员。
update-alert: true
# 设置为 true 以启用 /namlivechat update 命令。
# 这将把最新版本下载到服务器的 /update/ 文件夹中。
auto-update: true
messages/ 文件夹 (语言文件)
此文件夹包含语言文件 (en.yml, th.yml)。您可以编辑这些文件来更改插件发送给玩家的任何消息。您还可以创建新文件(例如西班牙语的 es.yml),并在 config.yml 中设置 language: "es" 以使用它。
youtube-config.yml
此文件控制与 YouTube 相关的所有设置。
# 整个 YouTube 模块的主开关。
enabled: true
# 您的 YouTube Data API v3 密钥。
youtube-api-key: "YOUR_API_KEY_HERE"
# 常规聊天消息的格式。
# 占位符: %player%, %message%
message-format: "&c[YouTube] &f%player%&7: &e%message%"
# 聊天中不同用户角色的颜色。
role-colors:
owner: "&6"
moderator: "&9"
member: "&a"
default: "&7"
# 下方所有事件警报的主开关。
youtube-alerts:
show-super-chat: true
show-new-members: true
# --- 事件配置 ---
# Super Chat 警报
super-chat:
# %player%, %amount%, %message%
message: "&6[Super Chat] &e%player% &f捐赠了 &a%amount%&f: &d%message%"
sound:
name: "entity.firework_rocket.large_blast"
volume: 1.0
pitch: 1.2
boss-bar:
enabled: true
# %player%, %amount%
message: "&e&l%player% &f&ldonated &a&l%amount%&f&l!"
# 颜色:BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW
color: "YELLOW"
duration: 12
# 新成员警报
new-member:
# %player%
message: "&b[New Member] &d%player% &ahas just subscribed!"
# ... (音效和 Boss Bar 设置)
# Super Sticker 警报
super-sticker:
# %player%, %amount%
message: "&a[Super Sticker] &e%player% &f发送了一个价值 &a%amount%&f 的贴纸!"
# ... (音效和 Boss Bar 设置)
# 赠送会员资格警报
gifted-membership:
# %gifter% (赠送会员资格的用户)
message: "&d[Gifted Member] &f%gifter% &e赠送了一份会员资格!"
# ... (音效和 Boss Bar 设置)
# 会员里程碑警报
member-milestone:
enabled: true
# %player%, %milestone% (例如:"12 months"), %message% (用户的自定义消息)
message: "&a[Milestone!] &e%player% &f已成为会员 &d%milestone%&f! 消息:&d%message%"
# ... (音效和 Boss Bar 设置)
twitch-config.yml
此文件控制与 Twitch 相关的所有设置。
# Twitch 模块的主开关。
enabled: true
# 你的 OAuth Token。
oauth-token: "YOUR_OAUTH_TOKEN_HERE"
# 普通聊天消息的格式。
# 占位符:%badges%, %user%, %message%
format: "&5[Twitch] %badges%%user%&7: &f%message%"
# 聊天中不同用户角色的颜色。
role-colors:
broadcaster: "&6"
moderator: "&9"
vip: "&d"
subscriber: "&a"
default: "&7"
# --- 事件配置 ---
events:
enabled: true
# 新关注者警报
new-follower:
enabled: true
# %user%
message: "&d[Twitch] &f%user% &e刚刚关注了!"
# ... (音效和 Boss Bar 设置)
# 新订阅警报
new-subscription:
enabled: true
# %user%, %tier%
message: "&d[Twitch] &f%user% &e刚刚以 Tier %tier% 级别订阅了!"
# ... (音效和 Boss Bar 设置)
# ... (以及其他如续订、赠送订阅、社区订阅等)
tiktok-config.yml
此文件控制与 TikTok 相关的所有设置。
# TikTok 模块的主开关。
enabled: true
# 普通聊天消息的格式。
# 占位符:%user%, %message%
message-format: "&b[TikTok] &f%user%&7: &f%message%"
# 聊天中不同用户角色的颜色。
role-colors:
moderator: "&9"
subscriber: "&a"
default: "&7"
# --- 事件配置 ---
events:
enabled: true
# 礼物警报
gift:
enabled: true
# %user%, %gift_name%, %amount% (连击数), %total_value% (钻石数量)
message: "&e[TikTok Gift] &f%user% &e发送了 %amount%x &d%gift_name% &a(价值:总钻石 %total_value%)!"
# ... (音效和 Boss Bar 设置)
# 关注警报
follow:
enabled: true
# %user%
message: "&b[TikTok] &f%user% &e关注了直播间!"
# ... (音效和 Boss Bar 设置)
? API 和 Token 设置
YouTube Data API v3 密钥
- 前往 Google Cloud Console。
- 创建一个新的项目。
- 在导航菜单中,转到“APIs & Services” -> “Library”。
- 搜索并启用 “YouTube Data API v3”。
- 在“APIs & Services” -> “Credentials”中,点击“Create Credentials” -> “API key”。
- 复制生成的 API 密钥。
- 将其粘贴到
youtube-config.yml 中的 youtube-api-key 字段中。
- 重要提示: 为了安全起见,点击新的 API 密钥,进入“API restrictions”,并将其限制为服务器的 IP 地址。
Twitch OAuth Tokens
- 前往 Twitch Token Generator。
- 点击 “Custom Scope” 令牌类型。
- 在作用域列表中,你必须选择以下内容:
chat:read
chat:edit
moderator:read:followers
- 点击“Generate Token!”按钮,并使用插件要使用的 Twitch 账户进行授权。
- 复制整个生成的令牌(它以
oauth: 开头)。
- 将其粘贴到
twitch-config.yml 中的 oauth-token 字段中。
? 命令与权限
| 命令 |
描述 |
权限 |
默认值 |
/livechat start <url> |
从 URL 自动检测平台并开始连接。 |
namlivechat.use |
true |
/livechat start <platform> <url/id> |
开始连接到特定平台。 |
namlivechat.use |
true |
/livechat stop [platform] |
停止当前连接。 |
namlivechat.use |
true |
/namlivechat reload |
重新加载所有配置文件。 |
namlivechat.admin |
op |
/namlivechat update |
下载最新的插件版本。 |
namlivechat.admin |
op |
? 使用的库
- Google API Client for Java
- Twitch4J
- TikTokLiveJava
由 Nattapat2871 创建。
English | ภาษาไทย
NamLivechat
Bridge the gap between your live stream and your Minecraft server. NamLivechat is a powerful, highly configurable plugin that brings your YouTube, Twitch, and TikTok live stream chats directly into the game. Keep your community engaged with real-time messages and a rich, customizable alert system without ever needing to switch screens. This plugin is built for performance and stability, with dedicated support for modern Folia and Paper servers.
How It Works (Core Concept)
The plugin uses different methods to connect to each platform, ensuring the most stable and efficient connection possible:
- YouTube: Connects via the official Google YouTube Data API v3 to poll for live chat messages and events.
- Twitch: Connects to Twitch's real-time IRC chat servers for instant message delivery and uses the Helix API to monitor for events like new followers.
- TikTok: Connects to TikTok's unofficial Webcast service using the
TikTokLiveJava library, mimicking a web browser to receive real-time events like comments and gifts.
✨ Features
- Multi-Platform Support: Connect to YouTube, Twitch, and TikTok live streams.
- Real-Time Chat: Displays live chat messages directly in Minecraft, featuring colored usernames based on their roles on each platform.
- Comprehensive Event Alerts: Get instant, highly customizable in-game notifications for all important events:
- YouTube: Super Chat, Super Stickers, New Members, Gifted Memberships, and Member Milestones.
- Twitch: New Followers, Subscriptions (New, Resubs), Gifted Subs, and Community Gift Bombs.
- TikTok: New Followers and Gifts.
- Advanced Alert System: Alerts are displayed in three configurable ways:
- Custom Chat Messages: Design unique alert messages for each event.
- Configurable Sounds: Assign specific sounds, volumes, and pitches for each alert.
- Dynamic Boss Bars: Important alerts appear on a Boss Bar, immediately replacing any previous alert to show the latest event.
- Full Customization: Almost every aspect is configurable via YAML files, including message formats, role colors, sounds, and Boss Bar styles.
- Multi-Language Support: All user-facing plugin messages can be translated. Default files for English (
en.yml) and Thai (th.yml) are provided.
- Semi-Automatic Updates:
- Update Checker: Automatically checks for new versions from GitHub and notifies admins upon joining.
- Update Command: A simple command (
/namlivechat update) downloads the latest version to the server's main update folder for a safe, automatic update on the next server restart.
- Debug Mode: A simple toggle in the
config.yml to show detailed console logs for easy troubleshooting.
⚙️ Compatibility
- Server Software: PaperMC & Folia (100% compatible).
- Minecraft Version: 1.21+
? Installation & First-Time Setup
- Download the latest
.jar file from the Releases page.
- Place the
NamLivechat-X.X.jar file into your server's plugins folder.
- Start your server once. The plugin will generate the following files and folders:
plugins/NamLivechat/config.yml
plugins/NamLivechat/youtube-config.yml
plugins/NamLivechat/twitch-config.yml
plugins/NamLivechat/tiktok-config.yml
plugins/NamLivechat/messages/en.yml
plugins/NamLivechat/messages/th.yml
- Stop the server.
- Follow the API & Token Setup guide below to configure the
youtube-config.yml and twitch-config.yml files.
- Start your server again and enjoy!
? Configuration
config.yml (Main Configuration)
This file controls the global settings of the plugin.
# ========================================= #
# NamLivechat General Settings #
# ========================================= #
# Set the language for in-game messages.
# Available languages are defined by the .yml files in the 'messages' folder.
language: "en"
# Set to true to enable detailed console logs for debugging purposes.
# It is recommended to keep this false during normal use.
debug-mode: false
# ========================================= #
# Update Settings #
# ========================================= #
# Set to true to notify admins in-game when a new version is available.
update-alert: true
# Set to true to enable the /namlivechat update command.
# This will download the latest version to the server's /update/ folder.
auto-update: true
messages/ folder (Language Files)
This folder contains the language files (en.yml, th.yml). You can edit these files to change any message the plugin sends to players. You can also create new files (e.g., es.yml for Spanish) and set language: "es" in config.yml to use it.
youtube-config.yml
This file controls all settings related to YouTube.
# Master switch for the entire YouTube module.
enabled: true
# Your YouTube Data API v3 Key.
youtube-api-key: "YOUR_API_KEY_HERE"
# Format for regular chat messages.
# Placeholders: %player%, %message%
message-format: "&c[YouTube] &f%player%&7: &e%message%"
# Colors for different user roles in chat.
role-colors:
owner: "&6"
moderator: "&9"
member: "&a"
default: "&7"
# Master switch for all event alerts below.
youtube-alerts:
show-super-chat: true
show-new-members: true
# --- Event Configurations ---
# Super Chat Alert
super-chat:
# %player%, %amount%, %message%
message: "&6[Super Chat] &e%player% &fhas donated &a%amount%&f: &d%message%"
sound:
name: "entity.firework_rocket.large_blast"
volume: 1.0
pitch: 1.2
boss-bar:
enabled: true
# %player%, %amount%
message: "&e&l%player% &f&ldonated &a&l%amount%&f&l!"
# Color: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW
color: "YELLOW"
duration: 12
# New Member Alert
new-member:
# %player%
message: "&b[New Member] &d%player% &ahas just subscribed!"
# ... (sound and boss-bar settings)
# Super Sticker Alert
super-sticker:
# %player%, %amount%
message: "&a[Super Sticker] &e%player% &fhas sent a sticker worth &a%amount%&f!"
# ... (sound and boss-bar settings)
# Gifted Membership Alert
gifted-membership:
# %gifter% (The user who gifted the membership)
message: "&d[Gifted Member] &f%gifter% &ehas gifted a membership!"
# ... (sound and boss-bar settings)
# Member Milestone Alert
member-milestone:
enabled: true
# %player%, %milestone% (e.g., "12 months"), %message% (user's custom message)
message: "&a[Milestone!] &e%player% &fhas been a member for &d%milestone%&f! Message: &d%message%"
# ... (sound and boss-bar settings)
twitch-config.yml
This file controls all settings related to Twitch.
# Master switch for the entire Twitch module.
enabled: true
# Your OAuth Token.
oauth-token: "YOUR_OAUTH_TOKEN_HERE"
# Format for regular chat messages.
# Placeholders: %badges%, %user%, %message%
format: "&5[Twitch] %badges%%user%&7: &f%message%"
# Colors for different user roles in chat.
role-colors:
broadcaster: "&6"
moderator: "&9"
vip: "&d"
subscriber: "&a"
default: "&7"
# --- Event Configurations ---
events:
enabled: true
# New Follower Alert
new-follower:
enabled: true
# %user%
message: "&d[Twitch] &f%user% &ehas just followed!"
# ... (sound and boss-bar settings)
# New Subscription Alert
new-subscription:
enabled: true
# %user%, %tier%
message: "&d[Twitch] &f%user% &ehas just subscribed at Tier %tier%!"
# ... (sound and boss-bar settings)
# ... (and so on for resubscription, gift-subscription, community-subscription)
tiktok-config.yml
This file controls all settings related to TikTok.
# Master switch for the entire TikTok module.
enabled: true
# Format for regular chat messages.
# Placeholders: %user%, %message%
message-format: "&b[TikTok] &f%user%&7: &f%message%"
# Colors for different user roles in chat.
role-colors:
moderator: "&9"
subscriber: "&a"
default: "&7"
# --- Event Configurations ---
events:
enabled: true
# Gift Alert
gift:
enabled: true
# %user%, %gift_name%, %amount% (combo count), %total_value% (diamonds)
message: "&e[TikTok Gift] &f%user% &ahas sent %amount%x &d%gift_name% &a(Value: %total_value% Diamonds)!"
# ... (sound and boss-bar settings)
# Follow Alert
follow:
enabled: true
# %user%
message: "&b[TikTok] &f%user% &ehas followed the stream!"
# ... (sound and boss-bar settings)
? API & Token Setup
YouTube Data API v3 Key
- Go to the Google Cloud Console.
- Create a new project.
- In the navigation menu, go to "APIs & Services" -> "Library".
- Search for and enable the "YouTube Data API v3".
- In "APIs & Services" -> "Credentials", click "Create Credentials" -> "API key".
- Copy the generated API key.
- Paste it into the
youtube-api-key field in your youtube-config.yml.
- Important: For security, click on the new API key, go to "API restrictions", and restrict it to your server's IP address.
Twitch OAuth Tokens
- Go to Twitch Token Generator.
- Click on the "Custom Scope" token type.
- In the list of scopes, you must select the following:
chat:read
chat:edit
moderator:read:followers
- Click the "Generate Token!" button and authorize with the Twitch account you want the plugin to use.
- Copy the entire generated token (it starts with
oauth:).
- Paste it into the
oauth-token field in your twitch-config.yml.
? Commands & Permissions
| Command |
Description |
Permission |
Default |
/livechat start <url> |
Auto-detects the platform from the URL and starts the connection. |
namlivechat.use |
true |
/livechat start <platform> <url/id> |
Starts a connection to a specific platform. |
namlivechat.use |
true |
/livechat stop [platform] |
Stops the current connection(s). |
namlivechat.use |
true |
/namlivechat reload |
Reloads all configuration files. |
namlivechat.admin |
op |
/namlivechat update |
Downloads the latest plugin version. |
namlivechat.admin |
op |
? Libraries Used
- Google API Client for Java
- Twitch4J
- TikTokLiveJava
Created by Nattapat2871.
评论 0
登录后参与评分
还没有评论,来抢沙发吧