Smart Inventory Sorter 自动整理 Minecraft 中的物品栏。它在玩家关闭存储容器时进行整理,在关闭玩家物品栏时进行整理,并在整理前合并部分堆叠以节省空间。该模组可以仅在服务端运行,也可以在单人游戏中运行,并支持可选的客户端控制功能。客户端模组并非必需:当模组安装于服务端时,原版客户端也能获得完整的自动整理功能和命令。
模组功能
- 当玩家关闭支持的存储容器(如箱子、双箱、末影箱、 barrels、潜影盒、漏斗、发射器、投掷器以及兼容的存储菜单)时进行整理(具体每个容器的开关取决于版本,请参阅配置部分)。
- 在玩家物品栏关闭后进行整理,主物品栏、快捷栏、护甲槽和副手槽有独立的开关(26.3 构建版;旧版构建仅在整理主物品栏时锁定快捷栏)。
- 在整理前合并兼容的部分堆叠,以腾出更多格子。
- 不会操作特殊界面,例如工作台、熔炉、高炉、烟熏炉、酿造台、铁砧、锻造台、切石机或附魔台。
- 在支持的容器界面中添加可选的紧凑 S 按钮、可选的 P 键绑定,以及用于手动整理的聊天命令。
- 纯手动模式会禁用所有自动整理功能,除非你按下 S 键、P 键或执行整理命令,否则不会移动任何物品。
- 按物品过滤功能允许你排除特定物品不参与整理,或使用物品 ID(如
minecraft:elytra)限制仅整理特定物品列表(26.3 构建版)。
支持版本
| Minecraft | Java | Modrinth 版本 | 文件 |
|---|---|---|---|
| 1.21 至 1.21.11 | 21 | 1.1.0 | smart-inventory-sorter-1.0.0-mc1.21-1.21.11.jar |
| 26.1 至 26.1.2 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0-mc26.1-26.1.2.jar |
| 26.2 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0.jar |
| 26.3 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0-mc26.3.jar |
保留了较旧的 1.0.0 文件供参考。请使用 1.1.0 以获取最新的修复和功能选项。
安装
仅服务端安装(推荐用于服务器):
- 安装与你的 Minecraft 版本匹配的 Fabric Loader 和 Fabric API。
- 将上表中对应的 JAR 文件放入服务器的 mods 文件夹中。
- 重启服务器。原版客户端无需安装客户端模组即可加入游戏。
单人游戏:
- 在你的客户端实例中安装 Fabric Loader 和 Fabric API。
- 将对应的 JAR 文件放入 mods 文件夹并启动游戏。
可选客户端功能:
- 在客户端也安装相同的 JAR 文件以启用 S 按钮和 P 键绑定。
- 设置
rawMode为true可隐藏两者,或者独立使用showSortButton和enableKeybind进行控制(26.3 构建版)。 - 客户端并非必需。当模组在服务端运行时,原版客户端也能使用自动整理和整理命令。
使用方法
- 自动模式:打开一个支持的容器,正常移动物品,然后关闭它。服务器会合并堆叠并整理内容。打开并关闭你的物品栏以整理已启用的物品栏部分。
- 仅按钮模式:将
manualSortingOnly设置为true,并通过/sort reload(26.3 版)或重启来重载。关闭容器时将不再自动整理。你可以随时通过 S 按钮、P 键或整理命令进行整理。 - 当安装了客户端模组且按钮已启用时,S 按钮会显示在支持的容器界面的左上角。
- 默认的整理快捷键是 P。你可以在控制设置屏幕中重新绑定。
命令
| 命令 | 描述 | 可用性 |
|---|---|---|
| /sort | 整理当前打开的存储容器;如果没有打开容器,则整理玩家物品栏 | 所有版本 (1.1.0) |
| /sort container | 整理当前打开的存储容器 | 26.3 构建版 |
| /sort inventory | 使用已启用的部分开关整理玩家物品栏 | 26.3 构建版 |
| /sort main | 同 /sort inventory | 26.3 构建版 |
| /sort hotbar | 仅整理快捷栏,暂时绕过快捷栏锁定 | 26.3 构建版 |
| /sort reload | 从磁盘重新加载 smart_sorter_config.json(需要管理员权限) | 26.3 构建版 |
在较旧的构建版(1.21, 26.1, 26.2)中,仅提供 /sort 命令:它整理当前打开的容器,或者在没有打开容器时整理玩家物品栏。
配置
配置文件位于 config/smart_sorter_config.json。首次运行时会自动生成带有默认值的配置文件。编辑后需重启游戏或服务器,或在 26.3 构建版中运行 /sort reload。
完整选项表(26.3 构建版):
| 设置项 | 描述 | 默认值 |
|---|---|---|
| rawMode | 隐藏客户端的 S 按钮和 P 键绑定;自动整理和命令仍可正常工作 | false |
| autoSortOnClose | 关闭时所有自动整理的主开关 | true |
| manualSortingOnly | 禁用所有自动整理;仅通过 S 按钮、P 键或命令进行整理 | false |
| sortChests | 整理箱子和双箱 | true |
| sortEnderChests | 整理末影箱 | true |
| sortBarrels | 整理 barrel | true |
| sortShulkers | 整理潜影盒 | true |
| sortHoppers | 整理漏斗 | true |
| sortDispensersDroppers | 整理发射器和投掷器 | true |
| sortOtherContainers | 整理其他安全的存储布局(包括兼容的模组存储) | true |
| sortPlayerInventoryOnClose | 在玩家物品栏关闭后对其进行整理 | true |
| sortPlayerMain | 包含主物品栏格子 9-35 | true |
| sortPlayerHotbar | 包含快捷栏格子 0-8(当 lockHotbar 为 true 时将被忽略) | false |
| sortArmorSlots | 包含护甲槽格子 36-39 | false |
| sortOffhandSlot | 包含副手处理 | false |
| lockHotbar | 在整理玩家物品栏期间保留所有九个快捷栏格子 | true |
| showSortButton | 显示或隐藏客户端的 S 按钮 | true |
| enableKeybind | 启用或禁用客户端的 P 键 | true |
| sortingMethod | 排序顺序:CREATIVE_TAB(创造模式标签)、ALPHABETICAL(字母顺序)或 ID | CREATIVE_TAB |
| excludedItems | 永远不会被移动的物品 ID 列表,例如 ["minecraft:elytra"] | [] |
| onlySortItems | 当非空时,仅这些物品 ID 参与整理 | [] |
旧版构建(1.21、26.1、26.2、版本 1.1.0)中的选项:rawMode、autoSortOnClose、manualSortingOnly、sortChests、sortBarrels、sortShulkers、sortOtherContainers、sortPlayerInventoryOnClose、lockHotbar、sortingMethod。Ender-chest、hopper、dispenser、per-part、button、keybind 和 item-filter 选项目前仅限 26.3 使用。
实用预设:
仅按钮排序(无自动化):
"autoSortOnClose": true,
"manualSortingOnly": true,
"showSortButton": true,
"enableKeybind": true
零界面,仅自动化:
"rawMode": true
绝不触碰特定物品:
"excludedItems": ["minecraft:nether_star", "minecraft:elytra"],
"onlySortItems": []
排序方法
- CREATIVE_TAB:按创造模式物品栏类别分组,然后按名称排序。
- ALPHABETICAL:按显示的物品名称排序,不区分大小写。
- ID:按物品注册表标识符排序。
要求
- Fabric Loader 和 Fabric API 需与你的 Minecraft 版本匹配(26.3 基于 Loader 0.19.5 和 Fabric API 0.161.0+26.3 构建)。
- Minecraft 1.21 至 1.21.11 需要 Java 21。
- Minecraft 26.1 至 26.1.2、26.2 和 26.3 需要 Java 25。
注意
- 该模组为服务器权威型:在服务器上它会编辑真实物品栏,因此结果会持久保存并让所有玩家保持同步。
- 在未加载模组的服务器上仅安装客户端模组无法对服务器端物品栏进行排序;如需此功能,请在服务器上安装该模组。
- 排序仅在物品栏关闭时运行一次,而非每 tick 运行,因此没有持续的背景开销。
- 26.3 的版本 1.1.0 还适配了 Mojang 在 26.3 中的更改:基于 SDL3 的输入系统(不再使用 GLFW 键常量)、用于管理命令的新服务器 PermissionSet 系统,以及 Screen 小部件注册方式的变更。
Smart Inventory Sorter automatically organizes inventories in Minecraft. It sorts storage containers when players finish using them, sorts player inventories on close, merges partial stacks before sorting, and can run server-side only, in singleplayer, or with optional client controls. The client mod is never required: vanilla clients get full automatic sorting and commands when the mod is installed on the server.
What the mod does
- Sorts chests, double chests, ender chests, barrels, shulker boxes, hoppers, droppers, dispensers, and compatible storage menus when the player closes them (exact per-container toggles depend on version, see Configuration).
- Sorts the player inventory after it closes, with separate toggles for main inventory, hotbar, armor, and offhand sections (26.3 build; older builds sort the main inventory with hotbar lock).
- Merges compatible partial stacks before sorting to free up slots.
- Never touches specialized menus such as crafting tables, furnaces, blast furnaces, smokers, brewing stands, anvils, smithing tables, stonecutters, or enchanting tables.
- Adds an optional compact S button in supported container screens, an optional P keybind, and chat commands for manual sorting.
- Manual-only mode disables every automatic sort so nothing moves unless you press S, press P, or run a sort command.
- Per-item filtering lets you exclude specific items from sorting or restrict sorting to a specific item list using item IDs such as minecraft:elytra (26.3 build).
Supported versions
| Minecraft | Java | Modrinth version | File |
|---|---|---|---|
| 1.21 to 1.21.11 | 21 | 1.1.0 | smart-inventory-sorter-1.0.0-mc1.21-1.21.11.jar |
| 26.1 to 26.1.2 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0-mc26.1-26.1.2.jar |
| 26.2 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0.jar |
| 26.3 | 25 | 1.1.0 | smart-inventory-sorter-1.0.0-mc26.3.jar |
Older 1.0.0 files are kept for reference. Use 1.1.0 for the latest fixes and options.
Installation
Server-side only (recommended for servers):
- Install Fabric Loader and Fabric API matching your Minecraft version.
- Place the matching JAR from the table above into the server mods folder.
- Restart the server. Vanilla clients can join with no client mod installed.
Singleplayer:
- Install Fabric Loader and Fabric API in your client instance.
- Place the matching JAR into the mods folder and launch the game.
Optional client features:
- Install the same JAR on the client to enable the S button and the P keybind.
- Set rawMode to true to hide both, or use showSortButton and enableKeybind independently (26.3 build).
- The client is never required. Automatic sorting and sort commands work for vanilla clients when the mod runs on the server.
How to use
- Automatic mode: open a supported container, move items normally, then close it. The server consolidates stacks and sorts the contents. Open and close your inventory to sort the enabled inventory parts.
- Button-only mode: set manualSortingOnly to true and reload with /sort reload (26.3) or restart. Nothing sorts on close anymore. Sort exactly when you want with the S button, the P key, or a sort command.
- The S button appears in the top corner of supported container screens when the client mod is installed and the button is enabled.
- The default sort key is P. It can be rebound in the controls screen.
Commands
| Command | Description | Availability |
|---|---|---|
| /sort | Sorts the open storage container, or the player inventory when no container is open | All versions (1.1.0) |
| /sort container | Sorts the currently open storage container | 26.3 build |
| /sort inventory | Sorts the player inventory using the enabled part toggles | 26.3 build |
| /sort main | Same as /sort inventory | 26.3 build |
| /sort hotbar | Sorts only the hotbar, temporarily bypassing the hotbar lock | 26.3 build |
| /sort reload | Reloads smart_sorter_config.json from disk (requires admin permission) | 26.3 build |
On older builds (1.21, 26.1, 26.2) only /sort is available: it sorts the open container, or the player inventory when no container is open.
Configuration
The file is config/smart_sorter_config.json. It is created with defaults on first run. Restart the game or server after editing, or run /sort reload on the 26.3 build.
Full option table (26.3 build):
| Setting | Description | Default |
|---|---|---|
| rawMode | Hides the client S button and P keybind; automatic sorting and commands keep working | false |
| autoSortOnClose | Master switch for all automatic sorting on close | true |
| manualSortingOnly | Disables all automatic sorting; sort only via S button, P key, or commands | false |
| sortChests | Sort chest and double-chest storage | true |
| sortEnderChests | Sort ender chests | true |
| sortBarrels | Sort barrels | true |
| sortShulkers | Sort shulker boxes | true |
| sortHoppers | Sort hoppers | true |
| sortDispensersDroppers | Sort dispensers and droppers | true |
| sortOtherContainers | Sort other safe storage layouts (including compatible modded storage) | true |
| sortPlayerInventoryOnClose | Sort the player inventory after it closes | true |
| sortPlayerMain | Include main inventory slots 9-35 | true |
| sortPlayerHotbar | Include hotbar slots 0-8 (ignored while lockHotbar is true) | false |
| sortArmorSlots | Include armor slots 36-39 | false |
| sortOffhandSlot | Include offhand handling | false |
| lockHotbar | Preserves all nine hotbar slots during player inventory sorting | true |
| showSortButton | Shows or hides the client-side S button | true |
| enableKeybind | Enables or disables the client-side P key | true |
| sortingMethod | Sort order: CREATIVE_TAB, ALPHABETICAL, or ID | CREATIVE_TAB |
| excludedItems | Item IDs that are never moved, for example ["minecraft:elytra"] | [] |
| onlySortItems | When non-empty, only these item IDs take part in sorting | [] |
Options on older builds (1.21, 26.1, 26.2, version 1.1.0): rawMode, autoSortOnClose, manualSortingOnly, sortChests, sortBarrels, sortShulkers, sortOtherContainers, sortPlayerInventoryOnClose, lockHotbar, sortingMethod. Ender-chest, hopper, dispenser, per-part, button, keybind, and item-filter options are 26.3-only for now.
Useful presets:
Button-only sorting (no automation):
"autoSortOnClose": true,
"manualSortingOnly": true,
"showSortButton": true,
"enableKeybind": true
Zero interface, automation only:
"rawMode": true
Never touch specific items:
"excludedItems": ["minecraft:nether_star", "minecraft:elytra"],
"onlySortItems": []
Sorting methods
- CREATIVE_TAB: groups items by Creative inventory category, then by name.
- ALPHABETICAL: sorts by displayed item name, case-insensitive.
- ID: sorts by item registry identifier.
Requirements
- Fabric Loader and Fabric API matching your Minecraft version (26.3 was built against Loader 0.19.5 and Fabric API 0.161.0+26.3).
- Java 21 for Minecraft 1.21 to 1.21.11.
- Java 25 for Minecraft 26.1 to 26.1.2, 26.2, and 26.3.
Notes
- The mod is server-authoritative: on servers it edits the real inventory, so results persist and stay in sync for all players.
- A client-only install on an unmodded server cannot sort server-side inventories; install the mod on the server for that.
- Sorting runs once when an inventory closes, not every tick, so there is no constant background cost.
- Version 1.1.0 for 26.3 additionally adapts to Mojang changes in 26.3: SDL3-based input (no more GLFW key constants), the new server PermissionSet system for admin commands, and the Screen widget registration change.
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Smart Inventory Sorter
下载 Smart Inventory Sorter
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复了玩家物品栏排序后留下空白并导致布局混乱的问题。现在已排序的物品会紧凑排列到每个启用部分的前方,而被排除的物品则保持原位。这也解决了在稀疏物品栏中按 P 键看似无效的问题。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧