Inventory Tweaks
Docs / Inventory Tweaks Remaked

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.

TIP On first launch the default configuration is created under 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.

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.

LoaderGame versionJar file name
Fabric1.20.1inventorytweaksremaked-fabric-1.20.1-1.1.0.jar
Fabric1.21 / 1.21.1 / 1.21.3 / 1.21.4 / 1.21.5 / 1.21.8 / 1.21.10 / 1.21.11inventorytweaksremaked-fabric-<version>-1.1.0.jar
Fabric26.1.2 / 26.2 / 26.3inventorytweaksremaked-fabric-<version>-1.1.0.jar
Forge 47.x1.20.1inventorytweaksremaked-forge-1.20.1-1.1.1.jar
NeoForge 21.x1.21 / 1.21.1 / 1.21.3 / 1.21.4 / 1.21.5 / 1.21.8 / 1.21.10 / 1.21.11inventorytweaksremaked-neoforge-<version>-1.1.1.jar
NeoForge 26.x26.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 overResult
Slots inside a chest (container)Only the container is sorted
Inventory / hotbarOnly the inventory is sorted
Crafting grid, buttons, empty GUI spaceContainer 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

AlgorithmFill orderBest for
DefaultFills item by item following the item tree orderEveryday inventory and chests
Vertical (by column)Column by column, top to bottomGrouping items by column
Horizontal (by row)Row by row, left to rightGrouping 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.

IconPositionTooltipAction
Leftmost of the sorting rowDefault sortingSorts the container with the configured default algorithm
Middle of the sorting rowSort by columnVertical: fills one column at a time
Middle of the sorting rowSort by rowHorizontal: fills one row at a time
Rightmost of the sorting rowInventory settingsOpens the Inventory Tweaks settings screen
Right end of the inventory row, left buttonMove items to containerClick: tops up container stacks that already exist; Shift: everything except the hotbar; Alt+Shift: everything
Right end of the inventory row, right buttonMove items to inventoryShift: pulls everything from the container back into your inventory
TIP The vertical/horizontal buttons only appear when the container is at most 9 slots wide. Containers that draw their own buttons (Sophisticated Backpacks, Sophisticated Storage and similar) make the whole row shift left so nothing overlaps.

Shortcuts

Default bindings are listed below. Change them from the “…” menu in your inventory, or edit config/InvTweaks/InvTweaks.cfg directly.

ActionDefault keyNotes
Sort the area under the cursorRWorks anywhere in game, no need to open the inventory
Sort (cycle algorithm)Middle clickCycles default / vertical / horizontal on chests
Move one itemCtrl + left clickMoves a single item from the stack
Move all items of the same typeCtrl + Shift + left clickMoves every stack of that item
Move one stackShift + left clickMoves the whole stack at once
Move everythingSpace + left clickMoves all items in the area regardless of type
Move to the upper area↑ + left clickMoves to the top half of the container / inventory
Move to the lower area↓ + left clickMoves to the bottom half
DropAlt + left clickDrops the item on the ground
Move to a hotbar slot1–9 + left clickPuts the item directly into that hotbar slot
Switch sorting profileR + 1–9The number matches the profile order in the rules file
Cycle sorting profilesHold R for about 1 secondSteps through the profiles in order
NOTE Switching profiles only does something when the rules file defines two or more profiles; the default file has only one.

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.

OptionDefaultDescription
enableAutoRefilltrueMaster switch
autoRefillBeforeBreakfalseReplace the tool before it actually breaks
autoRefillDamageThreshhold5Swap 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/:

FilePurpose
InvTweaks.cfgSwitches and key bindings (properties format)
InvTweaksRules.txtSorting rules and profiles
InvTweaksTree.txtItem category tree (XML content)
trees/*.treeExtra tree fragments merged into the main tree
InvTweaksCompatibility.xmlOptional container compatibility declarations
TIP You can open the rules file from the game: “…” → “Open the sorting rules file…”. Save it, switch back and sort once — no restart needed.

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).

SyntaxMeaning
D1Single slot: row D, column 1
DWhole row, left to right
1Whole column, bottom to top by default
A5-C9Rectangle from A5 to C9
A1-C3Rectangle, another corner order (fill direction differs)
TIP Rectangles can be written as 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:

ModifierMeaning
rReverse: right to left, or top to bottom
vVertical 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

SyntaxEffect
<target> LOCKEDNothing else is placed into these slots; a more specific target overrides it (D LOCKED is overridden by D1 torch)
<target> FROZENItems 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
NOTE Both styles work: 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

AttributeUsed onDescription
idItemRegistry name, e.g. minecraft:stone
damageItemVariant value, wildcard by default
dmin / dmaxCategoryGenerate entries for a damage range
classCategoryMatch by class: armor, sword, bow, pickaxe, shovel, axe, hoe, shears, arrow, fishing
dataCategoryExtra conditions such as data="toolclass:pickaxe", data="armortype:head", data="isshield:true"; comma-separated
orderAnyOrder among siblings
mergePrevious / mergeChildrenAnyMerge order with the previous entry / children, keeping certain items together
treeVersionRootGame 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.

NOTE A mistyped keyword in the item tree makes the matching rules line an invalid keyword; the game reports it in chat.

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.