Skip to content

Rules reference: laying out your inventory

This page is the reference for rules.txt and for category files. The player guide introduces every feature.

You write rules in a plain text file: this slot is for my sword, that row is for blocks. Press the sort key and everything goes where its rule says, and the rest is tidied by kind.

  1. Open your Minecraft folder’s config/delverstally/rules.txt. Delver’s Tally writes it on first launch, with example rules that are switched off.
  2. Remove the # in front of a rule to switch it on, or write your own.
  3. Save the file. The next time you open your inventory, the new rules are in use. No restart.
  4. Press R with your inventory open.

If a line has a mistake, the game tells you in chat which line and what is wrong, skips that line, and uses the rest. Mistakes in the file lists each message.

# Lines starting with # are comments.
[Default]
h:1 sword
h:2 pickaxe
h:3 axe
h:4 shovel
h:8 minecraft:torch
h:9 food
3:* blocks
1:1..1:4 ores columns
lock h:5
refill never minecraft:ender_pearl
armor never minecraft:golden_helmet
preserve never minecraft:flint_and_steel
[Building]
h:1..h:6 blocks
h:9 food
lock h:7..h:8

With the Default set, a sort puts your sword in the first hotbar slot, torches in the eighth, food in the ninth, blocks along the bottom row of the inventory, and ores in the top-left corner. Hotbar slot 5 is locked. Ender pearls are never refilled, a golden helmet is never put on for you, and a flint and steel is used until it breaks.

A # starts a comment only at the start of a line. Capital letters do not matter anywhere; a rule set’s name is shown the way you wrote it.

A zone names one or more slots. Your inventory is a grid of 4 rows and 9 columns. Rows 1, 2, and 3 are the main inventory from top to bottom, and row h is the hotbar. Columns run 1 to 9 from the left.

Zone How to write it Example
One slot <row>:<column> h:3, 2:5
A rectangle two opposite corners with .. between 1:1..2:4
A whole row <row>:* 3:*
A whole column, all four rows *:<column> *:9
The main inventory, without the hotbar main
Everything inventory

Each rule is one line.

Rule What it does
<zone> <what> [fill] When you sort, and when you pick an item up, items that match <what> go to the zone.
lock <zone> Locks every slot in the zone.
refill never <what> Matching items are never refilled into your hand, and never moved in to refill another.
armor never <what> Matching armor is never put on for you.
preserve never <what> Matching items are left out of equipment preservation: no warning, no swap or move out of your hand or off your body, and a sort may put them in the hotbar however worn they are. You use them until they run out. For modded tools that do not break at zero durability.

The optional fill word says which way a zone fills:

  • rows: left to right, then down. This is what you get with no fill word.
  • columns: top to bottom, then across.
  • reverse: from the zone’s last slot backward.
Match How to write it Example
A category its name pickaxe, food, blocks
One item its ID minecraft:torch
Every item in a tag # and the tag’s ID #minecraft:logs
Every item from one mod @ and the mod’s ID @create
Anything any

A category also matches everything in the categories under it: equipment matches swords, pickaxes, and every other tool. A plain word is always read as a category, so an item needs its mod’s prefix: minecraft:torch, not torch.

An item or tag the game does not have is not a mistake: the rule waits for a pack that has it.

A line like [Building] starts a rule set, and the rules under it belong to that set. Rules written before any [Name] line belong to a set called Default.

  • One set is in use at a time: the one named by “Rule set” in the settings screen (active_rule_set in config/delverstally/settings.json).
  • Bind Next Rule Set in Controls to step through the sets, in the order the file lists them, while an inventory is open. The new set’s name shows above your hotbar. The key is there while Delver’s Tally’s shortcuts are on.
  • Two sets cannot share a name, whatever the capitals.
  1. The rule with the smaller zone wins: one slot beats a row.
  2. Between zones of the same size, the more exact match wins: an item, then a tag, then a category deep in the list, then a category near the top, then a mod, then any.
  3. If they are still tied, the rule written first wins.

A zone takes only as many stacks as fit. What is left over goes to the next rule that matches it. Items that no rule claims fill the slots that no rule names, in sort order, the main inventory first and then the hotbar, and after those any other free slot.

While “Place picked-up items by rules” is on, and Sorting is on, an item you pick up goes to the zone your rules give it without a sort: with the rule h:5 sword, a sword you walk over ends up in hotbar slot 5 a moment after the game puts it in the first free slot.

  • It moves only into an empty slot of the zone, or onto a stack of the same item there with room. Delver’s Tally never pushes another item out to make room, and never moves anything into or out of a locked slot.
  • When the zone is full, the next rule that claims the item gets it. What no zone has room for stays where the game put it.
  • When a pickup joins a stack you already had, that whole stack moves, as it would when you sort.
  • A stack of blocks or other stackable items in the hotbar slot you have selected is never moved: it may be the stack you are placing from. A sword or tool that lands there is placed.
  • A tool that is nearly used up is never placed in the hotbar (Worn tools and locked slots).
  • Nothing moves while any screen is open, or for a second after you close a chest or your inventory. Press the sort key there.

Two things keep an item out of the slot a rule gives it:

  • A tool or armor piece that is nearly used up takes no hotbar slot while the main inventory has room for it, and is never put on for you. A preserve never rule lifts this for its items. The player guide explains equipment preservation.
  • A locked slot is never filled or emptied. lock <zone> locks slots for one rule set, and stays until you remove the rule; the lock key locks and unlocks a slot as you play. The player guide explains locked slots.

Each mistake gives one chat line, for example:

Delver's Tally: rules.txt line 7: unknown category "pickaxes"
The message says What to check
unknown category The word is not a category name. The list is below.
is not a zone Rows are 1, 2, 3, and h; columns are 1 to 9.
is not a category, item, #tag, @mod, or any The word has a character an ID cannot have, such as a space or !.
is not rows, columns, or reverse The third word of a rule can only be one of those.
the rule stops after The rule is missing what comes next: what it matches, or the zone of a lock.
unexpected … after the rule There is an extra word at the end of the line.
is not a [Name] header A rule set line needs both brackets and a name between them. The rules under it are skipped until the next good [Name] line.
a rule set named … already exists Rename one of the two sets. The rules under the second are skipped.

If the file cannot be read at all, one line says so, and the rules that last worked stay in use.

Categories decide the order items sort in, and give rules their names. The built-in list, in sort order:

Category Under it
equipment sword, axe, pickaxe, shovel, hoe, bow, crossbow, trident, shield, fishing_rod, shears, flint_and_steel, other_tools
armor helmet, chestplate, leggings, boots, elytra
food
potions
ammunition
blocks building, and natural with logs, leaves, saplings, plants, dirt_and_stone
materials ores, raw, ingots, gems, dust
redstone
transport
mob_drops
misc

Items that fit no category sort after all of them. misc itself holds no items until a pack gives it some, so a rule that names misc moves nothing.

A pack can add categories, add items to the built-in ones, or replace one. Categories are read on the player’s computer, so they come from resource packs, not data packs:

  1. The built-in list.
  2. Every resource pack’s files at assets/<namespace>/delverstally/categories/*.json. A mod or a KubeJS script that supplies resource pack files can ship them the same way. One path is taken: assets/delverstally/delverstally/categories/default.json is the built-in list’s own, and a pack’s file there is ignored.
  3. The player’s own config/delverstally/categories.json, read last.

They reload with resource packs (F3 + T).

{
"data_version": 1,
"categories": [
{ "name": "equipment", "children": [
{ "name": "hammer", "match": ["#c:hammers", "@mighty_hammers"] }
]},
{ "name": "gadgets", "match": ["@gadgets"] }
]
}

This file adds a hammer category under the built-in equipment, and a new gadgets category at the end of the list.

  • data_version is 1.
  • name is lowercase letters, digits, and _. A name is used once in the whole list, and any is not a name.
  • match lists what belongs in the category: item IDs, # tags, @ mods, or any, written as in rules. A category cannot match by another category’s name.
  • children are the categories under it. Order in the file is sort order.
  • A category whose name is already in the list is merged into it where it is: its match entries are added, and its children are merged the same way. A new name goes last under the category it was written in.
  • "replace": true on a category replaces the existing one of that name, with everything under it, in the same place.
  • An item belongs to the deepest category that matches it. Between two equally deep, the one earlier in the list wins.

To take over a built-in category, replace it:

{
"data_version": 1,
"categories": [
{ "name": "food", "replace": true, "match": ["#c:foods", "@farmersdelight"] }
]
}

A category with a mistake is skipped, with a warning in the log that names the file and the category, and the rest of the file still loads. A file that is not valid JSON, or whose data_version is not 1, is skipped whole.

Button and padlock textures for pack makers

Section titled “Button and padlock textures for pack makers”

A resource pack can redraw the sort buttons and the two padlocks. They are in assets/delverstally/textures/gui/:

File Size Shows
sort_standard.png 9 by 18 The packed sort button
sort_rows.png 9 by 18 The one-item-per-row button
sort_columns.png 9 by 18 The one-item-per-column button
padlock.png 5 by 6 The mark on a slot locked with the lock key
padlock_rule.png 5 by 6 The mark on a slot a lock rule names

A button file holds two pictures, one above the other: the button on top, and the button with the mouse over it below. A file may be larger, as long as it keeps the same shape: the built-in Delver’s Tally 32x pack has each at twice the size. The game draws them at the same size on screen either way. Make each pixel fully solid or fully clear: a half-clear pixel is not blended with what is behind it.