AntiNbtKick
一款 Fabric 模组,防止玩家因背包中过大的 NBT 数据而被踢出服务器。该模组智能监控并限制背包大小,在让你有效管理物品的同时,确保你免受服务器踢出的困扰。
功能
?️ 背包大小保护
- 智能大小检查:使用 Minecraft 基于 CODEC 的编码准确计算物品的大小(字节数)
- 最大限制:强制执行 1,777,777 字节的总背包数据限制(包括所有槽位和元数据开销)
- 元数据计算:每个槽位计入 128 字节的开销,以进行正确的大小跟踪
? 全面的背包监控
模组跟踪并检查以下内容:
- 主背包槽位(36 个槽位)
- 快捷栏(9 个槽位)
- 副手槽位
- 盔甲槽位(4 个槽位)
- 所有 NBT 数据和物品属性
? 多模式保护
拾取地面物品:
- 防止拾取会使背包超出限制的物品
- 静默阻止收集 oversized 物品
容器交互(生存与创造模式):
- Shift-Click:如果会导致超出限制,则阻止从容器中向你的背包移动物品
- 单击:防止将过大的物品放入你的背包
- 拖拽操作:如果会导致超出限制,则阻止将物品拖入你的背包
- 存入容器:允许你将物品自由地从背包移动到容器中,即使已超出限制
创造模式保护:
- 如果会导致超出限制,则阻止创造模式放置物品
- 防止导致背包溢出的创造模式拖拽/涂抹操作
- 阻止对 oversized 物品进行创造模式克隆(中键点击)
? 简单的切换命令
使用简单的聊天命令控制模组:
| 命令 |
描述 |
/apk |
显示当前模组状态 |
/apk toggle |
切换模组开/关 |
/apk on |
启用模组 |
/apk off |
禁用模组 |
/apk status |
显示详细状态 |
状态消息使用颜色编码:
工作原理
大小计算
模组使用 Minecraft 原生的 ItemStack.CODEC 将物品准确编码为 NBT 格式,并测量其序列化后的大小(字节)。这与服务器计算背包数据大小的方式相匹配,确保一致性。
智能拦截
模组智能地:
- ✅ 允许 拾取地面物品(除非已达到限制)
- ✅ 允许 将物品存入容器(清理你的背包)
- ✅ 允许 在你自己的背包内移动物品
- ❌ 阻止 添加会超出限制的新物品
- ❌ 阻止 从容器将物品拖入你的背包
- ❌ 阻止 创造模式下放置 oversized 物品
配置
- 默认状态:启动时启用
- 可切换:使用
/apk toggle 随时启用/禁用
- 无需配置文件:开箱即用,具有合理的默认值
安装
- 下载模组 JAR 文件
- 将其放入
.minecraft/mods 文件夹
- 使用 Fabric Loader 启动 Minecraft
- 模组将默认处于激活状态
要求
- Minecraft:1.21.4 或更高版本
- Fabric Loader:0.16.4 或更高版本
- Java:21 或更高版本
- Fabric API:任何与你 Minecraft 版本兼容的版本
故障排除
问:我无法将物品放入背包
答:你的背包可能已达到或接近 1,777,777 字节的限制。请使用 /apk off 禁用模组,或将物品存入容器。
问:我可以将物品拖入容器吗?
答:当然可以!你始终可以将物品从你的背包移动到容器中,即使已超出限制。这是预期的清理方式。
问:这会影响多人游戏吗?
答:是的,模组在任何服务器上都能保护你。它防止你达到会导致被踢出的服务器端 NBT 大小限制。
问:我可以禁用模组吗?
答:可以!使用 /apk off 禁用所有保护。使用 /apk on 重新启用。
致谢
- 原作者: UnicornMaster-Dev
- Minecraft 版本: 1.21.4
远离 NBT 踢出! ✨
AntiNbtKick
A Fabric mod that prevents players from getting kicked due to oversized NBT data in their inventory. This mod intelligently monitors and restricts inventory size to keep you safe from server kicks while still allowing you to manage your items effectively.
Features
?️ Inventory Size Protection
- Smart Size Checking: Accurately calculates the byte size of items using Minecraft's CODEC-based encoding
- Maximum Limit: Enforces a 1,777,777 byte limit for total inventory data (includes all slots and metadata overhead)
- Metadata Accounting: Each slot accounts for 128 bytes of overhead for proper size tracking
? Comprehensive Inventory Monitoring
The mod tracks and checks:
- Main inventory slots (36 slots)
- Hotbar (9 slots)
- Offhand slot
- Armor slots (4 slots)
- All NBT data and item attributes
? Multi-Mode Protection
Ground Item Pickup:
- Prevents picking up items that would exceed inventory limit
- Silently blocks oversized items from being collected
Container Interactions (Survival & Creative):
- Shift-Click: Blocks moving items FROM containers INTO your inventory if it would exceed the limit
- Single Click: Prevents placing items into your inventory that are too large
- Drag Operations: Blocks dragging items into your inventory when it would exceed the limit
- Container Depositing: Allows you to freely move items FROM your inventory INTO containers, even when over the limit
Creative Mode Protection:
- Blocks creative mode item placement if it would exceed the limit
- Prevents creative mode dragging/painting that would overflow your inventory
- Blocks creative mode cloning (middle-click) of oversized items
? Easy Toggle Commands
Control the mod with simple chat commands:
| Command |
Description |
/apk |
Show current mod status |
/apk toggle |
Toggle mod on/off |
/apk on |
Enable the mod |
/apk off |
Disable the mod |
/apk status |
Display detailed status |
Status messages use color coding:
- ? GREEN: Mod is enabled
- ? RED: Mod is disabled
How It Works
Size Calculation
The mod uses Minecraft's native ItemStack.CODEC to accurately encode items into NBT format and measures their serialized size in bytes. This matches how the server calculates inventory data size, ensuring consistency.
Smart Blocking
The mod intelligently:
- ✅ Allows picking up items from the ground (unless already at limit)
- ✅ Allows depositing items into containers (cleaning your inventory)
- ✅ Allows moving items within your own inventory
- ❌ Blocks adding new items that would exceed the limit
- ❌ Blocks dragging items into your inventory from containers
- ❌ Blocks creative mode placement of oversized items
Configuration
- Default State: Enabled on startup
- Togglable: Use
/apk toggle to enable/disable on-the-fly
- No Config Files: Works out of the box with sensible defaults
Installation
- Download the mod JAR file
- Place it in your
.minecraft/mods folder
- Launch Minecraft with Fabric Loader
- The mod will be active by default
Requirements
- Minecraft: 1.21.4 or later
- Fabric Loader: 0.16.4 or later
- Java: 21 or later
- Fabric API: Any version compatible with your Minecraft version
Troubleshooting
Q: I can't place items in my inventory
A: Your inventory is likely at or near the 1,777,777 byte limit. Use /apk off to disable the mod, or deposit items into a container.
Q: Can I drag items into containers?
A: Yes! You can always move items FROM your inventory INTO containers, even when over the limit. This is the intended way to clean up.
Q: Does this affect multiplayer?
A: Yes, the mod protects you on any server. It prevents you from reaching the server-side NBT size limits that would cause kicks.
Q: Can I disable the mod?
A: Yes! Use /apk off to disable all protections. Use /apk on to re-enable.
Credits
- Original Author: UnicornMaster-Dev
- Minecraft Version: 1.21.4
Stay safe from NBT kicks! ✨
评论 0
登录后参与评分
还没有评论,来抢沙发吧