? MusicPlay - 为你的服务器打造的自定义音乐播放器
MusicPlay 是一款功能齐全的服务端音乐播放器插件,适用于 Paper/Spigot 服务器。上传你自己的 .ogg 音轨,通过内置的 HTTP 服务器进行分发,让玩家通过精美的物品栏 GUI 享受自定义音乐——无需客户端模组。
? 将任何 Minecraft 服务器变成一个真正的音乐平台。
✨ 功能特性
- ? 自定义音轨库 - 通过聊天中的链接上传任意
.ogg 音频文件。标题会自动从文件的元数据(Vorbis TITLE 标签)中读取。
- ?️ 物品栏 GUI 播放器 - 按住 Shift + 右键点击唱片机,或使用
/music play 命令打开简洁的音乐播放界面。
- ? 个人播放列表 - 每位玩家拥有独立的播放列表(最多 45 首曲目)。在库中右键添加曲目,在播放列表中按住 Shift + 左键移除。
- ⏭️ 自动切歌 - 当一首歌曲结束时,下一首会自动播放。在“库”模式和“播放列表”模式下均有效。
- ? 循环播放 - 正在播放你的播放列表?它将无缝循环。
- ? 内置资源包服务器 - 无需外部托管。MusicPlay 运行自己的 HTTP 服务器,并在玩家加入时发送资源包。
- ? 可读的曲目名称 - 忘掉
custom.track_1 这种名字吧。曲目标题从 .ogg 文件中提取,并在 UI 的所有地方显示。
- ? 音频转换 - 支持上传 MP3、WAV、FLAC、M4A 等格式。如果服务器上安装了
ffmpeg,插件会自动将音轨转换为 OGG 单声道(Minecraft 所需格式),质量为 192kbps。
- ? 单声道音频 - 所有转换后的音轨强制为单声道,确保游戏内正确的 3D 空间定位。
- ? 智能下载 - 自动跟随 HTTP 重定向(301/302/307/308),清理 URL 中的多余字符,并兼容任何 CDN。
- ? 完整本地化 - UI 和聊天中的所有字符串都存储在
lang.yml 中。只需几分钟即可将插件翻译成任何语言。
- ?️ 按玩家控制资源包 - 玩家可以选择不自动加载,改为手动安装资源包。
?️ 使用方法
对于玩家
- 请管理员放置一个 唱片机 并插入自定义唱片(通过
/music disk 获取)。
- 按住 Shift + 右键点击 唱片机以打开音乐播放器。
- 使用 GUI 按钮控制播放:
- ⏸ 暂停 / ▶ 恢复 - 停止或继续当前音轨。
- ⏮ 上一曲 / 下一曲 ⏭ - 切换音轨。
- ? 播放列表 - 打开你的个人播放列表。
- ? 音轨库 - 浏览所有可用音轨。右键点击 音轨可将其添加到你的播放列表。
- ➕ 添加音轨 - (仅限管理员)通过在聊天中粘贴下载链接来上传新的
.ogg 音轨。
对于管理员
- 放置唱片机,插入来自
/music disk 的自定义唱片。
- 使用
/music upload 并在聊天中粘贴 直接的 .ogg 下载链接。
⚠️ 重要提示: 链接必须是 直接下载 URL —— 必须以 .ogg 结尾并立即打开文件(而不是像 Google Drive 或 YouTube 这样的页面)。像 Dropbox(带 ?dl=1)、GitHub Releases 或直接 Web 服务器链接都可以很好地工作。
- 插件会下载文件(自动跟随任何重定向),读取其标题,重建资源包,并自动通知玩家。
? 格式转换: 如果链接指向的是 MP3、WAV、FLAC、M4A 等格式——如果服务器上安装了 ffmpeg,插件会自动将其转换为 OGG 单声道。如果没有 ffmpeg,请直接上传 .ogg 格式的音轨。
单声道是 Minecraft 中正确实现 3D 空间音频定位所必需的。
? 自定义唱片纹理: 在首次启动服务器后,会在 plugins/MusicPlay/textures/custom_disc.png 处生成一个文件。用你自己的 16×16 PNG 纹理替换它,为你的音乐唱片赋予独特的外观!替换后请使用 /music pack 重建资源包。
? 命令
| 命令 |
描述 |
权限 |
/music play |
打开音乐播放器 GUI |
— |
/music disk [sound] |
给予自己一张自定义音乐唱片 |
musicplay.disk |
/music upload |
通过聊天链接上传新的 .ogg 音轨 |
musicplay.upload |
/music pack |
手动重建资源包 |
musicplay.upload |
/music tracks |
列出所有可用的声音键 |
— |
/music linkrp |
获取资源包下载链接 |
— |
/music skiprp |
禁用资源包自动加载 |
— |
/music loadrp |
重新启用资源包自动加载 |
— |
/music help |
显示帮助信息 |
— |
⚙️ 技术细节
工作原理
- 你通过 URL 上传一个
.ogg 文件。
- MusicPlay 下载它,解析 Vorbis Comment 头部 以提取曲目标题和时长。
- 它重建包含音频文件和
sounds.json 的 .zip 资源包,然后通过内置的 Java HTTP 服务器 提供服务。
- 玩家在加入时接收该资源包。插件使用
world.playSound() 针对唱片机位置以实现空间音频。
- 一个轻量级的 1 秒计时器跟踪每位玩家的播放进度,并在音轨结束时触发自动切换。
资源包
MusicPlay 生成并托管自己的资源包。你需要暴露 HTTP 端口(默认:25604),以便玩家下载它。在 config.yml 中配置公共 URL:
resource-pack-public-url: "http://YOUR_SERVER_IP:25604/musicpack.zip"
http-port: 25604
本地化
所有 UI 文本位于 plugins/MusicPlay/lang.yml 中。首次启动时会提取默认文件——只需编辑值即可:
menu.pause: "⏸ 暂停"
menu.resume: "▶ 恢复"
menu.playlist: "? 播放列表"
# ... 依此类推
权限
| 权限 |
描述 |
musicplay.disk |
给予自定义音乐唱片 |
musicplay.upload |
上传音轨并重建资源包 |
? 要求
- 服务器: Paper 1.21+(或兼容分支)
- Java: 21+
- 端口: 用于资源包 HTTP 服务器的一个开放 TCP 端口(默认
25604)
? 致谢
由 Paper API 和 Adventure 文本组件精心打造。无需客户端模组——纯粹的服务端魔法。?
? MusicPlay - Custom Music Player for Your Server
MusicPlay is a fully-featured, server-side music player plugin for Paper/Spigot servers. Upload your own .ogg tracks, serve them through a built-in HTTP server, and let players enjoy custom music through a beautiful inventory GUI - no client mods required.
? Turn any Minecraft server into a real music platform.
✨ Features
- ? Custom Track Library - Upload any
.ogg audio file via a chat link. Titles are read automatically from the file’s metadata (Vorbis TITLE tag).
- ?️ Inventory GUI Player - Open a clean music player interface by Shift + Right-clicking your jukebox, or using
/music play.
- ? Personal Playlists - Every player has their own playlist (up to 45 tracks). Add tracks with Right-click in the library, remove them with Shift + Left-click in your playlist.
- ⏭️ Auto Track Switching - When a song ends, the next one plays automatically. Works in both Library mode and Playlist mode.
- ? Looping Playlists - Playing your playlist? It loops seamlessly.
- ? Built-in Resource Pack Server - No external hosting needed. MusicPlay runs its own HTTP server and sends the pack to players on join.
- ? Readable Track Names - Forget
custom.track_1. Track titles are extracted from the .ogg file and shown everywhere in the UI.
- ? Audio Conversion - Supports uploading MP3, WAV, FLAC, M4A and other formats. If
ffmpeg is installed on the server, the plugin automatically converts the track to OGG Mono (as required by Minecraft) at 192kbps quality.
- ? Mono Audio - All converted tracks are forced to mono, ensuring correct 3D spatial positioning in-game.
- ? Smart Download - Automatically follows HTTP redirects (301/302/307/308), sanitizes URLs from stray characters, and works with any CDN.
- ? Full Localization - Every string in the UI and chat is stored in
lang.yml. Translate the plugin to any language in minutes.
- ?️ Per-Player Resource Pack Control - Players can opt out of auto-loading and install the pack manually.
?️ How to Use
For Players
- Ask an admin to place a Jukebox and insert a custom disc (given via
/music disk).
- Shift + Right-click the jukebox to open the music player.
- Use the GUI buttons to control playback:
- ⏸ Pause / ▶ Resume - Stop or continue the current track.
- ⏮ Previous / Next ⏭ - Switch tracks.
- ? Playlist - Open your personal playlist.
- ? Track Library - Browse all available tracks. Right-click a track to add it to your playlist.
- ➕ Add Track - (Admins only) Upload a new
.ogg track by pasting a download link in chat.
For Admins
- Place a Jukebox, insert a custom disc from
/music disk.
- Use
/music upload and paste a direct .ogg download link in chat.
⚠️ Important: The link must be a direct download URL - it must end with .ogg and open the file immediately (not a page like Google Drive or YouTube). Services like Dropbox (with ?dl=1), GitHub Releases, or a direct web server link work great.
- The plugin downloads the file (following any redirects automatically), reads its title, rebuilds the resource pack, and notifies players automatically.
? Format Conversion: If the link points to an MP3, WAV, FLAC, M4A, etc. - the plugin automatically converts it to OGG Mono if ffmpeg is installed on the server. Without ffmpeg - upload tracks in .ogg format directly.
Mono is required for correct 3D spatial audio positioning in Minecraft.
? Custom Disc Texture: After the first server launch, a file will appear at plugins/MusicPlay/textures/custom_disc.png. Replace it with your own 16×16 PNG texture to give your music disc a unique look! Rebuild the pack with /music pack after replacing.
? Commands
| Command |
Description |
Permission |
/music play |
Open the music player GUI |
— |
/music disk [sound] |
Give yourself a custom music disc |
musicplay.disk |
/music upload |
Upload a new .ogg track via chat link |
musicplay.upload |
/music pack |
Rebuild the resource pack manually |
musicplay.upload |
/music tracks |
List all available sound keys |
— |
/music linkrp |
Get the resource pack download link |
— |
/music skiprp |
Disable auto resource pack loading |
— |
/music loadrp |
Re-enable auto resource pack loading |
— |
/music help |
Show help message |
— |
⚙️ Technical Details
How It Works
- You upload a
.ogg file via a URL.
- MusicPlay downloads it, parses the Vorbis Comment headers to extract the track title and duration.
- It rebuilds a
.zip resource pack containing the audio files and sounds.json, then serves it via a built-in Java HTTP server.
- Players receive the pack on join. The plugin uses
world.playSound() targeting the jukebox location for spatial audio.
- A lightweight 1-second timer tracks playback progress per player and triggers auto-switching when a track ends.
Resource Pack
MusicPlay generates and hosts its own resource pack. You need to expose the HTTP port (default: 25604) so players can download it. Configure the public URL in config.yml:
resource-pack-public-url: "http://YOUR_SERVER_IP:25604/musicpack.zip"
http-port: 25604
Localization
All UI text lives in plugins/MusicPlay/lang.yml. On first launch the default file is extracted — just edit the values:
menu.pause: "⏸ Pause"
menu.resume: "▶ Resume"
menu.playlist: "? Playlist"
# ... and so on
Permissions
| Permission |
Description |
musicplay.disk |
Give custom music discs |
musicplay.upload |
Upload tracks and rebuild packs |
? Requirements
- Server: Paper 1.21+ (or compatible fork)
- Java: 21+
- Port: One open TCP port for the resource pack HTTP server (default
25604)
? Credits
Built with love using the Paper API and Adventure text components. No client mods required - pure server-side magic. ?
评论 0
登录后参与评分
还没有评论,来抢沙发吧