稀有拾取音效
一款轻量级的客户端 NeoForge 模组,当物品进入你的背包时会播放可配置的音效。为挖矿增添一丝兴奋感——当你终于挖到钻石时听到一声清脆的铃声,或者如果你想要那种意想不到的惊吓效果,可以播放带有诅咒意味的音效。
功能
- 拾取时随机自定义音效:从 rare1.ogg 到 rare50.ogg 中随机抽取
- 单物品概率:让下界之星以 100% 的概率触发,而泥土仅为 1/1000
- 白名单或黑名单模式:完全控制,支持如 #minecraft:ores 这样的物品标签
- 音量与音调随机化:每次触发听起来都独一无二
- 仅快捷栏模式:忽略护甲槽、副手槽和合成槽,防止刷屏
- 0.5 秒冷却时间:拾取一组 64 个物品不会让你震耳欲聋
- 即时配置重载:在游戏中更改设置,无需重启
- 资源包友好:自带 6 种音效,可覆盖/替换全部 50 种
- 模组兼容:已与 Sinytra Connector 及 100 多种其他模组测试过,因此它应该能在 Neoforge 上几乎任何地方正常工作。
仅客户端运行。在原版/模组服务器上均可使用,无需在服务端安装。
安装
- 为 1.21.1 安装 NeoForge
- 将 jar 文件放入 mods 文件夹
- 启动一次游戏以生成配置文件
可选:在资源包的 assets/rarepickupsounds/sounds/rare7.ogg 等位置添加自定义音效
配置
在游戏中访问:Mods > Rare Pickup Sounds > Config
默认白名单:diamond, netherite_ingot, nether_star, dragon_egg
添加自定义音效
- 创建资源包
- 将 .ogg 文件添加到 assets/rarepickupsounds/sounds/rare1.ogg, rare2.ogg, ... 直到 rare50.ogg
- 模组会自动检测该范围内的任何文件。缺失的数字会被安全跳过。
- 覆盖时无需编辑 sounds.json——只需将文件放入即可。
兼容性说明
Sinytra Connector:完全兼容。使用 FMLClientSetupEvent 以避免早期类加载。
Distant Horizons:已测试。无静态初始化冲突。
ItemSwapper / IPN:使用 EventPriority.LOWEST 在其他模组之后捕获背包变化。
常见问题
问:服务器需要安装此模组吗?
答:不需要。纯客户端模组。适用于任何服务器。
问:我可以只让下界合金工具播放音效吗?
答:可以。最简单的方法是手动添加每个物品:minecraft:netherite_sword, minecraft:netherite_pickaxe 等。
如果你的整合包添加了标签,你可以使用 #c:tools/netherite。要检查标签是否存在,请安装 JEI 或 EMI —— 在物品上按 U 键并查看底部的标签列表。原版 F3+H 不显示标签。如果标签不存在,请在日志中查找 Tag not found。
问:拾取一组物品时音效重叠
答:增加代码中的冷却时间或提高 globalRareChance。当前冷却时间为 0.5 秒。
问:即使概率为 100% 也没有音效播放
答:有多种原因可能导致无声拾取。请按以下顺序检查:
-
白名单/黑名单不匹配
如果 Use Blacklist Mode = false,则只有 Item List 中的物品会触发音效。如果你的列表为空或不包含你拾取的物品,则不会播放任何声音。
修复方法:将 minecraft:diamond 添加到 Item List,或将 Use Blacklist Mode 设置为 true 以允许所有物品。
-
物品概率覆盖全局概率
如果 Item Odds 中列出了类似 minecraft:diamond:1000 的项目,即使 Global Rare Chance = 1,它也会使用 1/1000 的概率。
修复方法:从 Item Odds 中移除该项目,或将其概率设置为 1 以实现 100%。在日志中查找 Item diamond has specific chance: 1000。
-
启用了仅快捷栏模式
如果 Hotbar Only Mode = true,则拾取到护甲槽、副手或合成格中的物品将被忽略。
修复方法:将 Hotbar Only Mode 设置为 false,或仅通过拾取到 0-35 号槽位进行测试。
-
音效文件缺失
如果 assets/rarepickupsounds/sounds/ 中没有 .ogg 文件,模组无法播放任何内容。
修复方法:在日志中查找 No .ogg files found! Using fallback sound.. 在该路径的资源包中添加 rare1.ogg,或验证模组 jar 是否捆绑了音效。
-
标签未找到或为空
如果你使用了 #c:tools/netherite 但该标签在你的整合包中不存在,Item List 实际上为空。
修复方法:在日志中查找 Tag c:tools/netherite not found。改用手动物品 ID,或安装 JEI 以验证标签是否存在。
-
冷却时间阻止刷屏
存在 0.5 秒的冷却时间。如果你一次性拾取 64 个钻石,你将只会听到 1-2 次音效,而不是 64 次。
修复方法:这是预期行为。逐个掉落物品以进行测试。
-
配置未重载
罕见错误:如果你在运行时直接编辑了 .toml 文件,更改可能不会应用。
修复方法:使用游戏内配置屏幕,或在编辑文件后重启 Minecraft。
-
维度过滤
如果你将 Only In Dimensions 设置为 ["minecraft:the_nether"],则在主世界不会播放音效。
修复方法:将 Only In Dimensions 留空以允许所有维度。
调试提示:将 Global Rare Chance 设置为 1,Item List 设置为 ["minecraft:dirt"],然后拾取泥土。如果你仍然听不到任何声音,请在 latest.log 中查找 [RarePickupSounds] 错误。
致谢
代码由 reg_the_galah 编写
捆绑音效:来自 1997 AstroRocks 2000,配音者 Nate Trost
许可证
MIT - 欢迎在整合包中使用、分叉或学习代码。
Rare Pickup Sounds
A subtle client-side NeoForge mod that plays configurable sounds when items enter your inventory. Adds a wee bit of excitement to mining — hear a rare chime when you finally grab that diamond or a cursed sfx if you want that unexpected spook.
Features
Random custom sounds on pickup - Pulls from rare1.ogg to rare50.ogg
Per-item odds - Make nether stars proc 100% while dirt is 1/1000
Whitelist or blacklist mode - Full control, supports item tags like #minecraft:ores
Volume + pitch randomization - Each proc sounds unique
Hotbar-only mode - Ignore armor/offhand/crafting slots to prevent spam
0.5s cooldown - Picking up a stack of 64 won't deafen you
Instant config reload - Change settings in-game, no restart
Resource pack friendly - Ships with 6 sounds, override/replace all 50
Mod compatible - Tested with Sinytra Connector with 100+ other mods so it should work with just about anything on Neoforge.
Client-side only. Works on vanilla/modded servers without needing it installed server-side.
Installation
Install NeoForge for 1.21.1
Drop the jar in your mods folder
Launch once to generate configs
Optional: Add custom sounds to a resource pack at assets/rarepickupsounds/sounds/rare7.ogg etc.
Configuration
Access in-game: Mods > Rare Pickup Sounds > Config
Default whitelist: diamond, netherite_ingot, nether_star, dragon_egg
Adding Custom Sounds
Create a resource pack
Add .ogg files to assets/rarepickupsounds/sounds/rare1.ogg, rare2.ogg, ... up to rare50.ogg
The mod auto-detects any file in that range. Missing numbers are skipped safely.
No sounds.json editing needed for overrides — just drop files in.
Compatibility Notes
Sinytra Connector: Fully compatible. Uses FMLClientSetupEvent to avoid early classloading.
Distant Horizons: Tested. No static init conflicts.
ItemSwapper / IPN: Uses EventPriority.LOWEST to catch inventory changes after other mods.
FAQ
Q: Does the server need this mod?
A: No. Purely client-side. Works on any server.
Q: Can I make only netherite tools play sounds?
A: Yes. The easiest way is to add each item manually: minecraft:netherite_sword, minecraft:netherite_pickaxe, etc.
If your modpack adds tags, you can use #c:tools/netherite instead. To check if a tag exists, install JEI or EMI — press U on the item and check the tags list at the bottom. Vanilla F3+H does not show tags. If the tag doesn't exist, check your logs for Tag not found.
Q: Sounds overlap when I pick up a stack
A: Increase cooldown in code or set globalRareChance higher. Current cooldown is 0.5s.
Q: No sounds play even at 100% chance
A: Multiple things can cause silent pickups. Check these in order:
-
Whitelist/blacklist mismatch
If Use Blacklist Mode = false, only items in Item List trigger sounds. If your list is empty or doesn't contain the item you picked up, nothing plays.
Fix: Add minecraft:diamond to Item List or set Use Blacklist Mode = true to allow all items.
-
Item Odds overriding Global Chance
If an item is listed in Item Odds like minecraft:diamond:1000, it uses 1/1000 odds even if Global Rare Chance = 1.
Fix: Remove the item from Item Odds or set its chance to 1 for 100%. Check logs for Item diamond has specific chance: 1000.
-
Hotbar-Only Mode enabled
If Hotbar Only Mode = true, items picked up into armor slots, offhand, or crafting grid are ignored.
Fix: Set Hotbar Only Mode = false or only test by picking up into slots 0-35.
-
Sound files missing
If no .ogg files exist in assets/rarepickupsounds/sounds/, the mod can't play anything.
Fix: Check logs for No .ogg files found! Using fallback sound.. Add rare1.ogg to a resource pack at that path, or verify the mod jar has bundled sounds.
-
Tag not found or empty
If you used #c:tools/netherite but the tag doesn't exist in your pack, Item List is effectively empty.
Fix: Check logs for Tag c:tools/netherite not found. Use manual item IDs instead, or install JEI to verify tags exist.
-
Cooldown blocking spam
There's a 0.5s cooldown. If you pick up 64 diamonds at once, you'll only hear 1-2 sounds, not 64.
Fix: This is intended. Drop items 1 by 1 to test.
-
Config didn't reload
Rare bug: If you edited the .toml directly while the game was running, changes might not apply.
Fix: Use the in-game config screen, or restart Minecraft after editing files.
-
Dimension filter
If you set Only In Dimensions to ["minecraft:the_nether"], sounds won't play in the Overworld.
Fix: Leave Only In Dimensions empty to allow all dimensions.
Debug tip: Set Global Rare Chance = 1, Item List = ["minecraft:dirt"], pick up dirt. If you still hear nothing, check latest.log for [RarePickupSounds] errors.
Credits
Code by reg_the_galah
Bundled sounds: from the 1997 AstroRocks 2000 voiced by Nate Trost
License
MIT - Feel free to use in modpacks, fork, or learn from the code.
评论 0
登录后参与评分
还没有评论,来抢沙发吧