InvAlert 会监控你的物品栏,并在可用空间耗尽的那一刻发出警告。再也不用辛辛苦苦挖掘一整条矿脉,结果却发现一半的圆石掉在地上无法拾取了——当背包只剩少量空格时,你会立刻听到提示声并看到提醒。
功能说明
- 追踪 36 个主物品栏槽位(快捷栏 + 背包)。盔甲栏和副手栏被排除在外,因为拾取到的物品永远不会进入这些栏位。
- 当剩余空格数降至 3 或以下 时,触发一次单次警告:
- 快捷栏上方显示操作栏消息:“物品栏几乎已满:N 个空格”。
- 播放一段简短的“叮”声,即使你没有盯着屏幕角落也能注意到。
- 在 HUD 的 左上角 显示一个持久性徽章:“背包:N 个空格”(当空格数为零时变为红色,并显示 “物品栏已满”)。
- 警告仅在可用空间进一步减少时重新触发(例如从 3 -> 1 -> 0),因此在你整理物品时不会频繁骚扰你。一旦你腾出任意一个空格,该徽章就会立即消失。
控制选项
- V — 切换警报开启/关闭状态。操作栏会确认当前状态。
设计初衷
你正身处洞穴深处,挖掘一条矿脉。背包很快满了。接下来掉落的十块矿石全部落在地上并最终消失。等你检查物品栏时,已经损失了一半的战利品。InvAlert 提供了最小化的解决方案:一个徽章、一声提示音、一条警报,无需配置界面,也无其他依赖。
注意事项
- 纯客户端模组——仅在你的客户端安装即可。适用于任何 Fabric 服务器,完全兼容原版游戏。
- 打开物品栏或其他界面时,声音和操作栏提示会被抑制,这样在你正在整理物品时不会产生噪音干扰。
- HUD 徽章遵循 F1 键隐藏 HUD 的设置。
- 代码约 140 行,无配置文件,除 Fabric API 外无任何依赖。
兼容性
Minecraft 1.21.8, 1.21.9, 1.21.10, 1.21.11 —— Fabric Loader 0.16+。单个 JAR 文件覆盖上述四个版本。将其放入 mods/ 文件夹,与 Fabric API 并列放置即可。
InvAlert watches your inventory and warns you the moment free space runs out. No more strip-mining a vein only to realize half the cobble fell on the floor — the moment your bag drops to a few free slots, you hear it and see it.
What it does
- Tracks the 36 main inventory slots (hotbar + backpack). Armor and the off-hand are excluded because picked-up items never go there anyway.
- When free slots drop to less than or equal to 3, it fires a one-shot warning:
- An action-bar message above the hotbar: "Inventory almost full: N free".
- A short pling sound, so you notice even when you're not looking at the corner.
- A persistent badge in the top-left of the HUD: "Bag: N free" (turns red and reads "Inventory FULL" when you hit zero).
- The warning re-fires only when free space drops further (3 -> 1 -> 0), so it doesn't spam you while you're managing items. The badge disappears the moment you free up a slot.
Controls
- V — toggle the alert on/off. Action-bar confirmation tells you the current state.
Why
You're deep in a cave, mining a vein. Your bag fills up. The next ten ores drop on the floor and despawn. By the time you check the inventory you've lost half the haul. InvAlert is the smallest possible fix: one badge, one sound, one alert, no config screens, no dependencies.
Notes
- Pure client-side — install on your client only. Works on any Fabric server, fully vanilla compatible.
- Sound and action bar are suppressed while an inventory or other screen is open, so the alert isn't noisy while you're already sorting.
- The HUD badge respects F1 (hide HUD).
- ~140 lines of code, no config files, no dependencies beyond Fabric API.
Compatibility
Minecraft 1.21.8, 1.21.9, 1.21.10, 1.21.11 — Fabric Loader 0.16+. One JAR covers all four. Drop into your mods/ folder alongside Fabric API.
评论 0
登录后参与评分
还没有评论,来抢沙发吧