Inventory Tweaks Remaked
Inventory sorting, container sorting, auto-refill and item trees — the modern port of Inventory Tweaks for Minecraft 1.12.2.
Drop the jar for your game version into the mods folder. It is a client-side mod: the server does not need it and no extra packets are sent.
config/InvTweaks/. Nothing is printed in chat; only one line is written to logs/latest.log.
Quick start
After installing, open your inventory: a “…” button appears in the top-right corner of the title bar. If it is there, the mod loaded correctly. Click it to open the settings screen.
- R: sorts the area under the cursor. You do not have to open the inventory first.
- Middle click: sorts; on chests, repeated clicks cycle through the three algorithms.
- Buttons at the right of the container title row: default sort, vertical, horizontal, settings and item transfer.
- Ctrl / Shift / Space / Alt + left click: move or drop items.
Rules, profiles and item categories live in config/InvTweaks/. No restart is needed: save the file, switch back to the game and sort once.
Installation
Each loader and game version has its own jar. Install only the file that matches your instance exactly.
| Loader | Game version | Jar file name |
|---|---|---|
| Fabric | 1.20.1 | inventorytweaksremaked-fabric-1.20.1-1.1.0.jar |
| Fabric | 1.21 / 1.21.1 / 1.21.3 / 1.21.4 / 1.21.5 / 1.21.8 / 1.21.10 / 1.21.11 | inventorytweaksremaked-fabric-<version>-1.1.0.jar |
| Fabric | 26.1.2 / 26.2 / 26.3 | inventorytweaksremaked-fabric-<version>-1.1.0.jar |
| Forge 47.x | 1.20.1 | inventorytweaksremaked-forge-1.20.1-1.1.1.jar |
| NeoForge 21.x | 1.21 / 1.21.1 / 1.21.3 / 1.21.4 / 1.21.5 / 1.21.8 / 1.21.10 / 1.21.11 | inventorytweaksremaked-neoforge-<version>-1.1.1.jar |
| NeoForge 26.x | 26.1.2 / 26.2 / 26.3 (Java 25 required) | inventorytweaksremaked-neoforge-<version>-1.1.1.jar |
Fabric builds need a matching Fabric Loader and Fabric API; Forge and NeoForge builds have no extra dependencies.
Basic sorting
R-key sorting follows the cursor
Which area gets sorted depends on where the mouse pointer is. You do not need to open the inventory first:
| Cursor over | Result |
|---|---|
| Slots inside a chest (container) | Only the container is sorted |
| Inventory / hotbar | Only the inventory is sorted |
| Crafting grid, buttons, empty GUI space | Container and inventory are sorted together (just the inventory if there is no container) |
Middle click
Middle click also uses the cursor position. On chests, repeated clicks cycle default → vertical → horizontal.
There is one special case: when the cursor is over a crafting input slot, the middle click does not sort. Instead it splits the stack evenly so you can lay out a recipe — when crafting sticks, for example, it keeps the wood split equally between the top and bottom slots.
Sorting algorithms
| Algorithm | Fill order | Best for |
|---|---|---|
| Default | Fills item by item following the item tree order | Everyday inventory and chests |
| Vertical (by column) | Column by column, top to bottom | Grouping items by column |
| Horizontal (by row) | Row by row, left to right | Grouping items by row |
Creative inventory
The creative item panel keeps only a settings button at the right end of its title row; R and the middle click never sort the creative item list.
Container buttons
The icons below reproduce the mod's actual 10×10 pixel art, enlarged to 30×30. Hovering for about 0.8 seconds shows the tooltip listed here.
| Icon | Position | Tooltip | Action |
|---|---|---|---|
| Leftmost of the sorting row | Default sorting | Sorts the container with the configured default algorithm | |
| Middle of the sorting row | Sort by column | Vertical: fills one column at a time | |
| Middle of the sorting row | Sort by row | Horizontal: fills one row at a time | |
| Rightmost of the sorting row | Inventory settings | Opens the Inventory Tweaks settings screen | |
| Right end of the inventory row, left button | Move items to container | Click: tops up container stacks that already exist; Shift: everything except the hotbar; Alt+Shift: everything | |
| Right end of the inventory row, right button | Move items to inventory | Shift: pulls everything from the container back into your inventory |
Shortcuts
Default bindings are listed below. Change them from the “…” menu in your inventory, or edit config/InvTweaks/InvTweaks.cfg directly.
| Action | Default key | Notes |
|---|---|---|
| Sort the area under the cursor | R | Works anywhere in game, no need to open the inventory |
| Sort (cycle algorithm) | Middle click | Cycles default / vertical / horizontal on chests |
| Move one item | Ctrl + left click | Moves a single item from the stack |
| Move all items of the same type | Ctrl + Shift + left click | Moves every stack of that item |
| Move one stack | Shift + left click | Moves the whole stack at once |
| Move everything | Space + left click | Moves all items in the area regardless of type |
| Move to the upper area | ↑ + left click | Moves to the top half of the container / inventory |
| Move to the lower area | ↓ + left click | Moves to the bottom half |
| Drop | Alt + left click | Drops the item on the ground |
| Move to a hotbar slot | 1–9 + left click | Puts the item directly into that hotbar slot |
| Switch sorting profile | R + 1–9 | The number matches the profile order in the rules file |
| Cycle sorting profiles | Hold R for about 1 second | Steps through the profiles in order |
Auto-refill
When you eat something, break a tool or run a stack of blocks dry, the mod automatically moves a matching item from your inventory into the current slot.
| Option | Default | Description |
|---|---|---|
enableAutoRefill | true | Master switch |
autoRefillBeforeBreak | false | Replace the tool before it actually breaks |
autoRefillDamageThreshhold | 5 | Swap when remaining durability drops below this value |
Which items may be refilled is controlled by the autorefill line in the rules file; slots marked FROZEN never take part in auto-refill.
Configuration files
Everything lives under config/InvTweaks/:
| File | Purpose |
|---|---|
InvTweaks.cfg | Switches and key bindings (properties format) |
InvTweaksRules.txt | Sorting rules and profiles |
InvTweaksTree.txt | Item category tree (XML content) |
trees/*.tree | Extra tree fragments merged into the main tree |
InvTweaksCompatibility.xml | Optional container compatibility declarations |
Sorting rules (InvTweaksRules.txt)
Each line is one constraint with exactly two fields:
<target> <keyword>
The target is a position in the inventory (slot, row, column or rectangle); the keyword comes from the item tree. For example, D5 pickaxe puts the best available pickaxe into the fifth slot of the bottom row (the hotbar).
The default file already contains D LOCKED, which keeps the hotbar from being filled by automatic sorting.
Targets
The inventory is numbered as 9 columns by 4 rows: columns 1–9 left to right, rows a–d top to bottom (d is the hotbar).
| Syntax | Meaning |
|---|---|
D1 | Single slot: row D, column 1 |
D | Whole row, left to right |
1 | Whole column, bottom to top by default |
A5-C9 | Rectangle from A5 to C9 |
A1-C3 | Rectangle, another corner order (fill direction differs) |
A1-C3, C3-A1, A3-C1 or C1-A3. They are not equivalent: the first corner decides where filling starts. Pick whichever matches your habit.
Modifiers
Append them to the target; they can be combined:
| Modifier | Meaning |
|---|---|
r | Reverse: right to left, or top to bottom |
v | Vertical first: top to bottom before left to right (mainly for rectangles) |
For example Ar fills row 1 in reverse, and A1-C5v fills a rectangle vertically first.
Keywords
Item names and many category names can be used directly: pickaxe, edibleFood, blocks, equipment and so on. The full list is the content of the item tree file.
Keywords ignore case and spaces: woodenSword, WOODSWORD and Wooden Sword are equivalent.
Locked and frozen
| Syntax | Effect |
|---|---|
<target> LOCKED | Nothing else is placed into these slots; a more specific target overrides it (D LOCKED is overridden by D1 torch) |
<target> FROZEN | Items in these slots never move, neither by sorting nor by auto-refill |
autorefill <keyword> | Only auto-refill items matching the keyword (all items if omitted) |
Multiple profiles
Start a profile with a single word followed by a colon; the following rules belong to it:
Mining:
D1 pickaxe
D2 torch
Fighting:
D1 sword
D5 edibleFood
Switch by holding R for about a second to cycle, or press 1–9 + R to jump directly to a profile (the first one is 1).
Official example
The rules used by the original author:
Default:
D1 pickaxe
D2 axe
D3 shovel
D4 sword
D5 edibleFood
D9 torch
A1-C5v stuff
A9-C6v blocks
Full example
# lines starting with # are comments
[Default]
# weapons in column 1
1 weapon
# blocks in row 1
a block
# food in a single slot
a1 food
# lock the bottom-right two slots
b8-c9 locked
# only refill tools
autorefill tool
Default: (official docs) and [Default] (section style). Keep one style per file.
Item tree (InvTweaksTree.txt)
The item tree defines the keywords available to rules and the order of items inside a category. Order matters: with D1 sword, swords listed earlier are preferred.
Structure and custom categories
The file is XML with a fixed root element, stuff. Custom categories are nested directly inside; the element name becomes the new keyword:
<stuff treeVersion="1.20.1">
<myCategory>
<dirt id="minecraft:dirt"/>
<cake id="minecraft:cake"/>
</myCategory>
</stuff>
Now a rule using myCategory matches only dirt and cake. Items do not need to be removed from their original categories; one item may appear in several. New categories are best placed near the top, right under <stuff>.
IDs and variants
Some items need a damage value to be told apart:
<sexyWools>
<magentaWool id="minecraft:wool" damage="2"/>
<pinkWool id="minecraft:wool" damage="6"/>
<purpleWool id="minecraft:wool" damage="10"/>
</sexyWools>
Special data
Potions, named items and similar need extra data to be identified uniquely:
<specialPotion>
<specialPotionA id="minecraft:potion" data='{Potion:"minecraft:strong_healing"}'/>
</specialPotion>
<specialPickaxe id="minecraft:diamond_pickaxe"
data='{display:{Name:"My Special Pickaxe"}}'/>
Attributes
| Attribute | Used on | Description |
|---|---|---|
id | Item | Registry name, e.g. minecraft:stone |
damage | Item | Variant value, wildcard by default |
dmin / dmax | Category | Generate entries for a damage range |
class | Category | Match by class: armor, sword, bow, pickaxe, shovel, axe, hoe, shears, arrow, fishing |
data | Category | Extra conditions such as data="toolclass:pickaxe", data="armortype:head", data="isshield:true"; comma-separated |
order | Any | Order among siblings |
mergePrevious / mergeChildren | Any | Merge order with the previous entry / children, keeping certain items together |
treeVersion | Root | Game version the tree was written for; only recorded. When it changes the old file is backed up and rebuilt |
Extending and merging
Put extra fragments into config/InvTweaks/trees/ with a .tree extension; they are merged into the main tree at launch. Delete a broken one and it will be rebuilt, with the old file kept as *.bak.
Container compatibility (InvTweaksCompatibility.xml)
This file does not exist by default; create it when needed. It tells the mod which containers should show buttons and which should show only the settings button:
<root>
<!-- treat as a chest: show sorting buttons -->
<chest class="mod.container.MyChestContainer" row_size="9" large_chest="false"/>
<!-- treat as a plain container: settings button only -->
<inventory class="mod.container.MyInventoryContainer" disable_buttons="false"/>
</root>
It only carries the most basic compatibility information and does not work with every mod; if a container misbehaves, ask its author for API support first.
FAQ
Chat says “Mod can't work because it couldn't find…”
A default configuration resource is missing from the jar (usually a packaging problem). Delete config/InvTweaks/ and restart; a correct build recreates it.
Pressing R does nothing
Check three things: the sorting key (R by default, see Options → Controls); the current screen allows sorting; the cursor is over a slot, which decides the area.
Modifier + left click does nothing
Check that enableShortcuts=true in InvTweaks.cfg, and that “Shortcuts” is enabled in the settings screen. Bindings must not conflict with vanilla keys.
R + number / holding R does nothing
With a single profile there is nothing to switch to. Add at least one more profile such as Mining:.
Config changes have no effect
Rules and key bindings apply on the next sort; restart the client after editing the item tree. If the tree was rebuilt after an update, the old file is kept as *.bak in config/InvTweaks/.
Modded items are not sorted the way I want
Edit InvTweaksTree.txt and add items by id to the category you want. To find an id, press F3 + H to enable advanced tooltips and hover the item.
The icons look bad with my resource pack
Buttons are drawn with the vanilla button texture by default. Ship an assets/inventorytweaks/textures/gui/button10px.png in your pack to override it.