BTW Music Player
BTW Music Player 是一个动态音乐引擎,作为 Minecraft 1.6.4 的 Better Than Wolves Community Edition 3.0.0 模组的附加组件而创建。它替换了游戏内标准且重复的背景音乐,允许根据游戏情境播放自定义曲目。
玩家可以创建并安装自己的“音乐包”(Music Packs),其中包含音乐文件和定义每首曲目播放时机的 songs.json 文件。该模组具有歌曲间的平滑过渡功能,并能智能管理战斗音乐,对玩家和怪物的行动做出反应。
特性
- 完整的音乐自定义:使用你自己的
.ogg 文件替换整个游戏的原声带。
- 智能播放列表逻辑:在启动时全局随机打乱曲目(如同洗牌)。模组确保特定情境下的每首歌曲至少播放一次后才会循环。即使你离开并返回某个区域,播放状态也会被记住,从而防止音乐重复并确保你能听到你的整个曲库。
- 平滑过渡:当情境发生变化时,音乐会柔和地淡入淡出,消除突兀的切断感。
- 智能战斗系统:战斗音乐的触发不仅是在玩家被攻击时,也包括玩家主动发起战斗时。只要附近有威胁存在,系统就会持续播放战斗主题音乐。
- 情境感知播放:基于广泛的条件定义音乐播放规则:
- 维度:主世界、下界、末地。
- 一天中的时间:白天或夜晚。
- 生物群系:游戏中的任何生物群系(例如:森林、沙漠、针叶林)。
- 天气:晴朗或多暴风雨。
- 位置:在地表与洞穴中播放不同的音乐。
- 战斗:为与怪物、狼或鱿鱼的遭遇战提供专用音乐。
- Boss 战:为对抗末影龙和凋灵的战斗提供独特曲目。
- 胜利:击败 Boss 后播放特殊主题音乐。
- 菜单音乐:定义在主菜单、世界选择屏幕以及脱离游戏世界时的选项界面播放的曲目。
- 低血量叠加音效:当玩家生命值降至 5 颗心或以下时,心跳音效(或任何其他声音)会与背景音乐同时播放。
- 智能生物群系逻辑:生物群系变体(例如:森林丘陵、沙漠丘陵)会自动被视为其主要生物群系,简化了配置过程。
- 无缝旅行体验:河流和海滩被视为“透明”区域。穿越河流时,前一个生物群系(例如:森林)的音乐会继续播放,防止音乐频繁切换。
- 高级验证器:模组会检查你的
.ogg 文件是否存在且有效,并直接在音乐包选择菜单中报告错误。
- 多音乐包支持:可以加载来自单个特定音乐包的曲目,也可以一次性加载所有已安装音乐包的曲目。
- 游戏内配置:通过新的齿轮图标,直接从游戏选项菜单中管理设置、选择音乐包并打开音乐文件夹。
- 全局条件开关:可以直接在游戏内配置菜单中启用或禁用特定条件(例如:禁用所有生物群系音乐或战斗音乐)。
- 诊断命令:使用
/bmp debug 实时查看当前音乐状态(生物群系、战斗、歌曲优先级),并使用 /bmp reload 在不重启游戏的情况下重新加载配置和音乐包。
- 正在播放通知:当新歌曲开始时,屏幕右侧会出现一个时尚的弹出窗口,显示曲目标题和音乐包名称。
- 自定义歌曲标题:你现在可以在
songs.json 文件中为每首歌曲定义自定义显示标题。
下载
要求
- 已安装 Better Than Wolves Community Edition 3.0.0
模组安装
- 从下载部分下载最新的模组
.jar 文件。
- 打开你的 Minecraft 目录。
- 在你的
.minecraft 目录中找到 mods 文件夹。
- 将下载的
btw-music-player-x.y.z.jar 文件移动到 mods 文件夹中。
- 启动游戏。
音乐包安装
成功安装模组后,你可以添加任意数量的音乐包以自定义游戏内音乐。
- 从下载部分下载音乐包(例如 RadogostMusicPack.zip)。
- 导航到你的主 Minecraft 游戏目录 (
.minecraft)。
- 在
.minecraft 目录中,找到名为 musicpacks 的文件夹。如果不存在,你必须创建它。
- 解压下载的
.zip 归档文件。里面会有一个包含音乐包名称的文件夹(例如 RadogostMusicPack)。
- 重要提示:将整个文件夹(例如
RadogostMusicPack)移动到 musicpacks 目录中。不要直接复制单独的 .ogg 文件或 songs.json 文件。
重新启动游戏后,音乐包将根据配置文件中的设置自动加载。
示例文件夹结构
安装模组和两个示例音乐包(RadogostMusicPack 和 AnotherCoolMusicPack)后,你的文件结构应如下所示:
.minecraft/
├── mods/
│ ├── btwce-3.0.x.jar
│ └── btw-music-player-x.y.z.jar
│
├── musicpacks/
│ ├── RadogostMusicPack/
│ │ ├── songs.json
│ │ ├── day/
│ │ │ └── kam_01_spirit.ogg
│ │ └── combat/
│ │ └── witcher_52_monster_battle.ogg
│ │
│ └── AnotherCoolMusicPack/
│ ├── songs.json
│ └── ... (音乐文件)
│
└── ... (其他 Minecraft 文件和文件夹)``````
配置
你可以在游戏内直接配置模组!
- 进入 Options(选项)。
- 寻找 Music(音乐)滑块。
- 点击滑块旁边的小 齿轮图标。
此菜单允许你:
- 浏览并验证已安装的 Music Packs(绿色 = 有效,红色 = 缺少文件或格式无效)。
- 管理活动条件:打开“歌曲条件”屏幕以全局启用或禁用特定规则(例如关闭所有生物群系检查)。
- 在
ALL(加载所有包)和 SINGLE(仅加载一个特定包)模式之间切换。
- 调整 Context Delay、Crossfade(淡入淡出持续时间)和 Cave Depth 滑块。
- 切换 Debug Logging。
- 使用 Open Folder 按钮快速打开电脑上的
musicpacks 文件夹。
或者,你也可以手动编辑位于 .minecraft/config/btw-music-player.cfg 的配置文件。
可用选项
musicpack_loading_mode
- 描述: 决定模组如何加载音乐包。
- 值:
ALL(默认)- 模组会加载 musicpacks 文件夹中找到的所有音乐包的音乐。
SINGLE - 模组仅加载一个特定音乐包的音乐。
- 示例: 要仅使用一个音乐包,请将此值更改为 SINGLE。
single_musicpack_name
- 描述: 当
musicpack_loading_mode 设置为 SINGLE 时要激活的音乐包的名称。
- 值: 音乐包文件夹的确切名称(例如
RadogostMusicPack)。区分大小写。
- 示例:
single_musicpack_name=RadogostMusicPack
enable_debug_logging
- 描述: 在游戏控制台中启用或禁用详细的模组消息。这对于诊断问题或创建自己的音乐包很有用。
- 值:
false(默认)- 日志记录已禁用。
true - 日志记录已启用。
context_change_delay_seconds
- 描述: 设置在游戏上下文(例如生物群系、进入洞穴)改变后,音乐发生变化之前必须经过的延迟时间(秒)。这可以防止在区域间移动时出现令人烦恼的快速音乐切换。高优先级的音乐(战斗、Boss 战)将始终立即播放,忽略此延迟。
- 值:
7(默认)- 新上下文稳定 7 秒后音乐才会变化。
0 - 音乐变化是即时的。
fade_duration_ms
- 描述: 设置音乐变化时交叉淡入淡出效果的持续时间(毫秒)。
- 值:
1000(默认)- 1 秒淡入淡出。
0 - 无淡入淡出的瞬间切换。
cave_y_level
- 描述: 指定 Y 坐标(高度),低于该高度游戏认为玩家处于“洞穴”中。这会影响
is_in_cave 条件。
- 值:
show_notifications
- 描述: 决定音乐变化时是否显示“正在播放”弹出通知。
- 值:
true(默认)、false。
创建你自己的音乐包
任何人都可以创建自己的音乐包!过程涉及将音乐文件准备为 .ogg 格式,并在一个名为 songs.json 的特殊文件中定义播放规则。
0. 重要提示:音量标准化
在开始之前,我们强烈建议对所有音轨进行音量标准化。这将防止出现一个音轨太安静而下一个音轨太响的情况,从而避免你不得不不断调整游戏内的音乐滑块。
你可以使用免费程序 Audacity 来完成此操作。对于我的音乐包,我使用“Normalize”效果将其感知响度设为 -22 LUFS。这一步确保了专业和一致聆听体验。
1. 文件夹结构
首先,为你的音乐包创建一个主文件夹,例如 MyFirstMusicPack。在其中,你必须放置 songs.json 文件。你可以将音乐文件放在旁边,或者为了更好地组织,将它们分组到子文件夹中(例如 music、combat、boss)。
musicpacks/
└── MyFirstMusicPack/
├── songs.json
├── ambient/
│ ├── day_forest.ogg
│ └── night_plains.ogg
└── combat/
└── regular_fight.ogg
2. songs.json 文件
这是你的音乐包的核心。它是一个包含一系列“规则”的文本文件,告诉模组何时播放特定的音轨。每条规则由四部分组成:
file:音乐文件的路径。
title(可选):通知中显示的歌曲显示名称。
priority:一个数字,决定音轨的重要性。
conditions:一组必须满足的条件才能播放该音轨。
以下是一个包含两条规则的示例 songs.json 文件:
[
{
"file": "ambient/day_forest.ogg",
"title": "Spirit of the Woods",
"priority": 10,
"conditions": {
"dimension": "overworld",
"time_of_day": "day",
"biome": "forest"
}
},
{
"file": "combat/regular_fight.ogg",
"priority": 100,
"conditions": {
"is_in_combat": true
}
}
]
3. 优先级
如果同时满足多条规则的条件,优先级决定了哪个播放列表具有优先权。优先级数字最高的规则获胜。
示例: 你在白天的森林中(匹配 priority: 10 的规则),但一只僵尸突然袭击了你(也匹配优先级为 100 的战斗规则)。由于 100 大于 10,音乐将立即切换到战斗音轨。
提示: 对一般背景音乐(生物群系、一天中的时间)使用低优先级(例如 1-20),对特殊事件(如战斗、Boss 战或胜利主题)使用高优先级(例如 100+)。
4. 可用条件
下表列出了你可以在 conditions 部分中使用的所有条件,以定义你的规则。
| 条件键 |
接受的值 |
描述 |
| dimension |
overworld, the_nether, the_end |
指定玩家必须所在的维度。 |
| biome |
ocean, plains, desert, extreme_hills, forest, taiga, swampland, hell, sky, frozenocean, ice_plains, ice_mountains, mushroomisland, jungle |
指定生物群系。注意:丘陵(如 forest_hills)、边缘和海岸会自动映射到其父级生物群系(使用 forest、desert 等)。河流和海滩被忽略以保持之前的轨道,无法直接定位。 |
| time_of_day |
day, night |
指定游戏中的当前时间段。 |
| weather |
clear, storm |
检查天气是平静还是有风暴。 |
| is_in_cave |
true, false |
检查玩家是否位于配置的 Y 坐标以下(默认:60)。 |
| is_in_combat |
true, false |
检查玩家当前是否处于战斗状态。 |
| boss_type |
wither, ender_dragon |
检查附近是否有特定的首领。 |
| victory_after_boss |
true |
一种特殊条件,在击败首领后短时间内为真。 |
| is_menu |
true |
检查玩家是否在主菜单或任何非活跃世界屏幕中(例如:世界选择界面)。 |
| is_low_health |
true, false |
检查玩家的生命值是否为 5 颗心(10 HP)或更少。此条件会在当前音乐之上作为叠加层播放。 |
5. 提示与工具
- 文件格式:确保所有音乐文件均为 .ogg 格式。
- 使用诊断功能:你可以使用游戏内命令
/bmp debug 来查看特定歌曲正在播放(或未播放)的具体原因。它会显示当前的生物群系、战斗状态以及激活的歌曲优先级。
- 使用日志:如需更深入的分析,请在配置文件中启用
enable_debug_logging=true。游戏控制台将显示模组尝试执行操作的详细追踪信息。
- JSON 验证器:如果游戏未加载你的音乐包,请确保
songs.json 文件没有语法错误。你可以将其内容粘贴到在线 JSON 验证器中进行检查。
- 管理大型音乐包(CSV 转 JSON):
如果你计划添加数十甚至数百首曲目,手动编辑
songs.json 文件会变得非常繁琐。在这种情况下,你可以准备一个简单的电子表格,列顺序如下:
file,priority,dimension,biome,time_of_day,is_in_combat,weather,is_in_cave,boss_type,victory_after_boss,is_menu,is_low_health
将电子表格保存为 .csv 文件,然后使用我的辅助工具,它会自动将其转换为可直接使用的 songs.json 文件。
BTW Music Player
BTW Music Player is a dynamic music engine created as an addon for the Better Than Wolves Community Edition 3.0.0 mod for Minecraft 1.6.4. It replaces the standard, repetitive in-game music, allowing for custom tracks to be played based on the gameplay context.
Players can create and install their own "Music Packs" containing music files and a songs.json file that defines when each track should be played. The mod features smooth transitions between songs and intelligently manages combat music, reacting to actions from both the player and monsters.
Features
- Full Music Customization: Replace the entire game's soundtrack with your own
.ogg files.
- Smart Playlist Logic: Tracks are shuffled globally at launch (like a deck of cards). The mod ensures every song for a specific context plays at least once before looping. The playback state is remembered even if you leave and return to an area, preventing repetitive music and ensuring you hear your entire library.
- Smooth Transitions: Music gently fades in and out when the context changes, eliminating abrupt cuts.
- Intelligent Combat System: Combat music is triggered not only when the player is attacked but also when they initiate a fight. The system sustains the combat theme as long as a threat is nearby.
- Context-Aware Playback: Define music playback rules based on a wide range of conditions:
- Dimension: Overworld, Nether, The End.
- Time of Day: Day or night.
- Biome: Any biome in the game (e.g., Forest, Desert, Taiga).
- Weather: Clear skies or a storm.
- Location: Play different music on the surface versus in caves.
- Combat: Dedicated music for encounters with monsters, wolves, or squids.
- Boss Battles: Unique tracks for fights against the Ender Dragon and the Wither.
- Victory: A special theme plays after defeating a boss.
- Menu Music: Define tracks to play in the Main Menu, World Selection screen, and options when outside of the game world.
- Low Health Overlay: A heartbeat sound effect (or any other sound) plays simultaneously with the background music when the player's health drops to 5 hearts or below.
- Smart Biome Logic: Biome variants (e.g., Forest Hills, Desert Hills) are automatically treated as their main biome, simplifying configuration.
- Seamless Travel: Rivers and Beaches are considered "transparent". The music from the previous biome (e.g., Forest) continues to play while crossing a river, preventing constant music switching.
- Advanced Validator: The mod checks if your .ogg files exist and are valid, reporting errors directly in the Music Pack selection menu.
- Multi-Music Pack Support: Load tracks from a single, specific music pack or from all installed packs at once.
- In-Game Configuration: Manage settings, select music packs, and open the music folder directly from the game options menu via a new gear icon.
- Global Condition Toggles: Enable or disable specific conditions (e.g., disable all Biome music or Combat music) directly from the in-game configuration menu.
- Diagnostics Commands: Use
/bmp debug to view the current music state (biome, combat, song priority) in real-time, and /bmp reload to reload configuration and music packs without restarting the game.
- Now Playing Notifications: A stylish pop-up appears on the right side of the screen when a new song starts, displaying the track title and the name of the Music Pack.
- Custom Song Titles: You can now define a custom display title for each song in the
songs.json file.
Downloads
Requirements
- Better Than Wolves Community Edition 3.0.0 installed
Mod Installation
- Download the latest
.jar file for the mod from the Downloads section.
- Open your Minecraft directory.
- In your
.minecraft directory, find the mods folder.
- Move the downloaded
btw-music-player-x.y.z.jar file into the mods folder.
- Launch the game.
Music Pack Installation
After successfully installing the mod, you can add any number of music packs to customize the in-game music.
- Download a music pack (e.g., RadogostMusicPack.zip) from the Downloads section.
- Navigate to your main Minecraft game directory (
.minecraft).
- In the
.minecraft directory, find a folder named musicpacks. If it does not exist, you must create it.
- Unzip the downloaded
.zip archive. Inside, you will find a folder with the music pack's name (e.g., RadogostMusicPack).
- Important: Move the entire folder (e.g.,
RadogostMusicPack) into the musicpacks directory. Do not copy individual .ogg files or the songs.json file directly.
After restarting the game, the music packs will be loaded automatically according to the settings in the configuration file.
Example Folder Structure
This is what your file structure should look like after installing the mod and two example music packs (RadogostMusicPack and AnotherCoolMusicPack):
.minecraft/
├── mods/
│ ├── btwce-3.0.x.jar
│ └── btw-music-player-x.y.z.jar
│
├── musicpacks/
│ ├── RadogostMusicPack/
│ │ ├── songs.json
│ │ ├── day/
│ │ │ └── kam_01_spirit.ogg
│ │ └── combat/
│ │ └── witcher_52_monster_battle.ogg
│ │
│ └── AnotherCoolMusicPack/
│ ├── songs.json
│ └── ... (music files)
│
└── ... (other minecraft files and folders)``````
Configuration
You can configure the mod directly inside the game!
- Go to Options.
- Look for the Music slider.
- Click the small Gear Icon next to the slider.
This menu allows you to:
- Browse and validate installed Music Packs (Green = Valid, Red = Missing files or Invalid format).
- Manage Active Conditions: Open the Song Conditions screen to globally enable or disable specific rules (e.g., turn off all Biome checks).
- Toggle between
ALL (load all packs) and SINGLE (load one specific pack) modes.
- Adjust the Context Delay, Crossfade (fade duration), and Cave Depth sliders.
- Toggle Debug Logging.
- Quickly open the
musicpacks folder on your computer using the Open Folder button.
Alternatively, you can edit the configuration file manually at .minecraft/config/btw-music-player.cfg.
Available Options
musicpack_loading_mode
- Description: Determines how the mod should load music packs.
- Values:
ALL (default) - The mod loads music from all music packs found in the musicpacks folder.
SINGLE - The mod loads music from only one specific music pack.
- Example: To use only one music pack, change this value to SINGLE.
single_musicpack_name
- Description: The name of the music pack to be activated when
musicpack_loading_mode is set to SINGLE.
- Values: The exact name of the music pack folder (e.g.,
RadogostMusicPack). This is case-sensitive.
- Example:
single_musicpack_name=RadogostMusicPack
enable_debug_logging
- Description: Enables or disables detailed mod messages in the game console. This is useful for diagnosing issues or when creating your own music pack.
- Values:
false (default) - Logging is disabled.
true - Logging is enabled.
context_change_delay_seconds
- Description: Sets a delay (in seconds) that must pass before the music changes after the game context (e.g., biome, entering a cave) is altered. This prevents annoying, rapid music switching when moving between areas. High-priority music (combat, boss battles) will always play immediately, ignoring this delay.
- Values:
7 (default) - Music will change after the new context has been stable for 7 seconds.
0 - Music changes are immediate.
fade_duration_ms
- Description: Sets the duration (in milliseconds) of the crossfade effect when music changes.
- Values:
1000 (default) - 1 second fade.
0 - Instant cut with no fading.
cave_y_level
- Description: Specifies the Y coordinate (height) below which the game considers the player to be in a "cave". This affects the
is_in_cave condition.
- Values:
60 (default) - Standard sea level/underground start.
show_notifications
- Description: Determines whether the "Now Playing" pop-up should appear when the music changes.
- Values:
true (default), false.
Creating Your Own Music Pack
Anyone can create their own music pack! The process involves preparing your music files in .ogg format and defining playback rules in a special file called songs.json.
0. Important Tip: Volume Normalization
Before you begin, we strongly recommend normalizing the volume for all your tracks. This will prevent situations where one track is too quiet and the next is too loud, forcing you to constantly adjust the in-game music slider.
You can do this using a free program like Audacity. For my music pack, I used the "Normalize" effect to a perceived loudness of -22 LUFS. This step ensures a professional and consistent listening experience.
1. Folder Structure
First, create a main folder for your music pack, e.g., MyFirstMusicPack. Inside it, you must place the songs.json file. You can place your music files alongside it or, for better organization, group them into subfolders (e.g., music, combat, boss).
musicpacks/
└── MyFirstMusicPack/
├── songs.json
├── ambient/
│ ├── day_forest.ogg
│ └── night_plains.ogg
└── combat/
└── regular_fight.ogg
2. The songs.json File
This is the heart of your music pack. It's a text file containing a list of "rules" that tell the mod when to play a specific track. Each rule consists of four parts:
file: The path to the music file.
title (Optional): The display name of the song shown in notifications.
priority: A number that determines how important the track is.
conditions: A set of conditions that must be met for the track to be played.
Here is an example songs.json file with two rules:
[
{
"file": "ambient/day_forest.ogg",
"title": "Spirit of the Woods",
"priority": 10,
"conditions": {
"dimension": "overworld",
"time_of_day": "day",
"biome": "forest"
}
},
{
"file": "combat/regular_fight.ogg",
"priority": 100,
"conditions": {
"is_in_combat": true
}
}
]
3. Priority
Priority decides which playlist takes precedence if more than one rule's conditions are met at the same time. The rule with the highest priority number wins.
Example: You are in a forest during the day (matching the rule with priority: 10), but a zombie suddenly attacks you (also matching the combat rule with priority: 100). Since 100 is greater than 10, the music will immediately switch to the combat track.
Tip: Use low priorities (e.g., 1-20) for general background music (biomes, time of day) and high priorities (e.g., 100+) for special events like combat, boss battles, or victory themes.
4. Available Conditions
The following table lists all the conditions you can use in the conditions section to define your rules.
| Condition Key |
Accepted Values |
Description |
| dimension |
overworld, the_nether, the_end |
Specifies the dimension the player must be in. |
| biome |
ocean, plains, desert, extreme_hills, forest, taiga, swampland, hell, sky, frozenocean, ice_plains, ice_mountains, mushroomisland, jungle |
Specifies the biome. Note: Hills (e.g., forest_hills), edges, and shores are automatically mapped to their parent biome (use forest, desert, etc.). Rivers and Beaches are ignored to maintain the previous track and cannot be targeted directly. |
| time_of_day |
day, night |
Specifies the current time of day in the game. |
| weather |
clear, storm |
Checks if the weather is calm or if there is a storm. |
| is_in_cave |
true, false |
Checks if the player is below the configured Y level (Default: 60). |
| is_in_combat |
true, false |
Checks if the player is currently in combat. |
| boss_type |
wither, ender_dragon |
Checks if a specific boss is nearby |
| victory_after_boss |
true |
A special condition that is true for a short time after defeating a boss. |
| is_menu |
true |
Checks if the player is in the Main Menu or any screen outside of the active world (e.g., World Selection). |
| is_low_health |
true, false |
Checks if the player has 5 hearts (10 HP) or less. This tracks plays as an overlay on top of current music. |
5. Tips and Tools
- File Format: Ensure all your music files are in the .ogg format.
- Use Diagnostics: You can use the in-game command
/bmp debug to see exactly why a specific song is playing (or why it isn't). It displays the current biome, combat status, and active song priority.
- Use Logs: For deeper analysis, enable
enable_debug_logging=true in the config. The game console will show detailed traces of what the mod is trying to do.
- JSON Validator: If the game isn't loading your music pack, make sure your songs.json file is free of syntax errors. You can check it by pasting its content into an online JSON validator.
- Managing Large Music Packs (CSV to JSON):
If you plan to add dozens or hundreds of tracks, editing the
songs.json file by hand becomes tedious. In this case, you can prepare a simple spreadsheet with columns in the following order:
file,priority,dimension,biome,time_of_day,is_in_combat,weather,is_in_cave,boss_type,victory_after_boss,is_menu,is_low_health
Save the spreadsheet as a .csv file, and then use my helper tool, which will automatically convert it into a ready-to-use songs.json file.
评论 0
登录后参与评分
还没有评论,来抢沙发吧