自定义方块声音
让资源包重新定义方块声音——无需编码,无需数据包,只需一个 JSON 文件。
Custom Block Sounds 是一款轻量级 客户端 Fabric 模组,允许资源包作者覆盖任意方块的交互声音——甚至包括单个方块状态(blockstate)的声音——并为那些从未有过声音的方块添加 环境(空闲)声音。
功能特性
- 按方块或按方块状态覆盖 破坏 / 坠落 / 击中 / 放置 / 行走 声音
- 为任意方块添加 空闲(环境)声音 ——支持几率、冷却时间、昼夜、天气、露天、上方空气和集群条件
- 使用 原版声音 或随资源包附带的 自定义声音
- 每个声音独立的 音量 和 音调 控制
- 其他玩家和生物的脚步声、方块放置和坠落声音也会被替换——服务器发送的声音会与其所在位置的方块进行匹配
- 多个资源包自然合并——列表靠前的资源包优先级更高
- 无效条目绝不会导致游戏崩溃——它们会被跳过并在日志中给出清晰的警告
适用于 Minecraft 1.21 - 1.21.11(使用一个 jar 文件)以及 Minecraft 26.2 - 26.3(使用第二个文件,即 +26 文件)。需要 Fabric API。完全客户端侧——加入任何服务器都是安全的。
设置你的资源包
在你的资源包中创建一个文件:
assets/customblocksounds/config/blockmap.json
每一行代表一条规则:键 是方块(可选地带有方块状态属性),值 是一组参数。允许重复的键——每种声音类型写一行。
{
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]": "sound=minecraft:block.sand.break,type=break,volume=1.0,pitch=0.8",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]": "sound=minecraft:block.sand.step,type=step",
"minecraft:stone": "sound=mypack:custom_stone_step,type=step"
}
[...] 中的方块状态属性是可选的,也可以是部分的——只要列出的值匹配,该规则就会生效。更具体的规则(包含更多属性)优先级更高。
sound= 接受任何原版声音事件(例如 minecraft:block.sand.break——完整列表见原版的 sounds.json),或者在 你自己的资源包 的 assets/<namespace>/sounds.json 中声明的声音(像往常一样在 sounds.json 中声明,并将 .ogg 文件放在旁边)。
提示: 编辑 blockmap.json 后按下 F3+T ——配置将重新加载,无需重启游戏。
参数说明
| 参数 |
描述 |
type |
要替换的声音类型:break(破坏)、fall(坠落)、hit(击中)、place(放置)、step(行走,别名 walk)、idle(空闲,别名 ambient) |
sound |
声音事件 ID;非空闲类型时为可选(省略它可保留原版声音,仅更改音量/音调) |
volume |
0-16,默认值 1.0 |
pitch |
0-16,默认值 1.0 |
空闲(环境)声音
type=idle 为方块提供循环的环境音,类似于原版 1.21.5+ 中的沙漠沙子音效。额外参数如下:
| 参数 |
描述 |
默认值 |
idle_chance |
扫描器命中方块时播放的几率,范围 0-1 |
0.002 |
idle_cooldown |
此规则两次播放之间的最小秒数 |
0 |
idle_pitch_min / idle_pitch_max |
随机音调范围 |
0.9-1.1 |
idle_category |
使用的音量滑块类别:blocks(方块)、ambient(环境)、weather(天气)、players(玩家)、music(音乐)等... |
blocks |
idle_air_above |
true = 仅当上方方块为空气时播放 |
关闭 |
idle_sky |
true = 仅在露天环境下播放 |
关闭 |
idle_cluster |
仅当附近有 N 个相同方块时播放(水平 ±8,垂直 ±2) |
关闭 |
idle_time |
day(白天)或 night(夜晚) |
任意 |
idle_weather |
rain(下雨)或 clear(晴朗) |
任意 |
示例——类似沙漠沙子的环境音效:
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]": "sound=minecraft:block.sand.idle,type=idle,idle_chance=1.0,idle_cooldown=5,idle_air_above=true,idle_sky=true,idle_cluster=3,idle_time=day,idle_weather=clear"
全局空闲扫描器设置
每个资源包保留一个专用键(启用列表中最高优先级的资源包生效):
"customblocksounds:ambient": "idle_samples=64,idle_radius=24,idle_max_per_second=4"
| 参数 |
描述 |
默认值 |
最大值 |
idle_samples |
每刻检查玩家周围的位置数量 |
6 |
700 |
idle_radius |
水平扫描半径(垂直方向为一半) |
16 |
32 |
idle_max_per_second |
每秒空闲声音的全局上限 |
无限制 |
1000 |
在默认设置下,单个方块被找到的概率很低——这是类似原版沙漠密度的效果,专为方块区域调整。若要使单个方块的声音清晰可闻,请提高 idle_chance 和 idle_samples。
Custom Block Sounds
Let resource packs redefine block sounds - no coding, no datapacks, just one JSON file.
Custom Block Sounds is a lightweight client-side Fabric mod that lets resource pack authors override the interaction sounds of any block - even of a single blockstate - and add ambient (idle) sounds to blocks that never had them.
Features
- Override break / fall / hit / place / step sounds per block or per blockstate
- Add idle (ambient) sounds to any block - with chance, cooldown, day/night, weather, open-sky, air-above and cluster conditions
- Use vanilla sounds or custom sounds shipped in the same resource pack
- Per-sound volume and pitch control
- Other players' and mobs' footsteps, block placement and fall sounds are replaced too - server-sent sounds are matched against the block at their position
- Multiple resource packs merge naturally - the pack higher in the list wins
- Invalid entries never crash the game - they are skipped with a clear warning in the log
Works on Minecraft 1.21 - 1.21.11 with one jar and on Minecraft 26.2 - 26.3 with a second one (the +26 file). Requires Fabric API. Fully client-side - safe to join any server.
Setting up your resource pack
Create one file in your resource pack:
assets/customblocksounds/config/blockmap.json
Each line is one rule: the key is a block (optionally with blockstate properties), the value is a list of parameters. Duplicate keys are allowed - write one line per sound type.
{
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]": "sound=minecraft:block.sand.break,type=break,volume=1.0,pitch=0.8",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]": "sound=minecraft:block.sand.step,type=step",
"minecraft:stone": "sound=mypack:custom_stone_step,type=step"
}
- Blockstate properties in
[...] are optional and may be partial - a rule matches every state that has the listed values. A more specific rule (more properties) wins.
sound= accepts any vanilla sound event (e.g. minecraft:block.sand.break - full list in vanilla sounds.json) or a sound declared in your own pack's assets/<namespace>/sounds.json (declare it in
sounds.json as usual and put the .ogg next to it).
Tip: press F3+T after editing blockmap.json - the config reloads without restarting the game.
Parameters
| Parameter |
Description |
type |
which sound to replace: break, fall, hit, place, step (alias walk), idle (alias ambient) |
sound |
sound event id; optional for non-idle types (omit it to keep the vanilla sound and only change volume/pitch) |
volume |
0-16, default 1.0 |
pitch |
0-16, default 1.0 |
Idle (ambient) sounds
type=idle gives a block a looping ambience, like desert sand in vanilla 1.21.5+. Extra parameters:
| Parameter |
Description |
Default |
idle_chance |
chance to play when the scanner hits the block, 0-1 |
0.002 |
idle_cooldown |
minimum seconds between plays of this rule |
0 |
idle_pitch_min / idle_pitch_max |
random pitch range |
0.9-1.1 |
idle_category |
volume slider used: blocks, ambient, weather, players, music... |
blocks |
idle_air_above |
true = only when the block above is air |
off |
idle_sky |
true = only under open sky |
off |
idle_cluster |
only when N same blocks are nearby (±8 horizontally, ±2 vertically) |
off |
idle_time |
day or night |
any |
idle_weather |
rain or clear |
any |
Example - sand-like desert ambience:
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]": "sound=minecraft:block.sand.idle,type=idle,idle_chance=1.0,idle_cooldown=5,idle_air_above=true,idle_sky=true,idle_cluster=3,idle_time=day,idle_weather=clear"
Global idle scanner settings
One reserved key per pack (the highest enabled pack wins):
"customblocksounds:ambient": "idle_samples=64,idle_radius=24,idle_max_per_second=4"
| Parameter |
Description |
Default |
Max |
idle_samples |
positions checked around the player per tick |
6 |
700 |
idle_radius |
horizontal scan radius (vertical = half) |
16 |
32 |
idle_max_per_second |
global cap on idle sounds per second |
unlimited |
1000 |
A single block is found rarely with default settings - that's vanilla-like desert density, tuned for areas of blocks. For clearly audible single blocks raise idle_chance and idle_samples.
评论 0
登录后参与评分
还没有评论,来抢沙发吧