{"url":"https://levimc.org/mods/github.com/amatouhake/LaminaSort/","id":"github.com/amatouhake/LaminaSort","name":"LaminaSort","description":"Client-side inventory sorting and management mod for Minecraft Bedrock Edition, built on LeviLamina.","owner":"amatouhake","logo":"https://levimc.org/mods/icons/e0dc274e335b8ab0-288.webp","repository":"https://github.com/amatouhake/LaminaSort","issues":"https://github.com/amatouhake/LaminaSort/issues","releases":"https://github.com/amatouhake/LaminaSort/releases","stars":1,"downloads":198,"updated":"2026-09-20T16:48:33Z","published":"2026-09-20T16:48:33Z","created":"2026-09-20T07:33:38Z","license":"MIT","side":["client"],"platform":["win-x64"],"gameVersions":["1.26.51"],"tags":["platform:levilamina","type:mod"],"latest":{"variant":"client","version":"0.1.0","install":"lip install github.com/amatouhake/LaminaSort#client@0.1.0"},"readmes":[{"file":"README.md","lang":"en","text":"# LaminaSort\n\nA client-side inventory sorting mod for Minecraft Bedrock Edition, built on\n[LeviLamina Client](https://github.com/LiteLDev/LeviLamina).\n\nLaminaSort automates the ordinary inventory organisation a player performs by\nhand: it merges compatible partial stacks and arranges the result into\nsensible sections (Shulker Boxes, gear, items, blocks) that follow the game's\nown Creative order, using the same client inventory machinery that the mouse\ndoes. It is not an inventory editor, needs no server component and never\ntouches server-authoritative state directly.\n\n## Target\n\n* LeviLamina **v26.51.3** (client)\n* Minecraft Bedrock Edition **1.26.51.x** (Windows x64)\n\nRequires only the Minecraft client with LeviLamina: no server mod, operator\npermissions, cheats, commands or experiments.\n\n## Current scope (MVP)\n\n* Press the **Sort** key (default `R`, remappable under *Settings → Keyboard &\n  Mouse* as `LaminaSort.sort`) while an inventory or container screen is open.\n* The **main 27 player inventory slots** are sorted. The hotbar, armour,\n  offhand, crafting and every other special slot are never touched.\n* When an ordinary storage container (chest, trapped chest, ender chest,\n  barrel, shulker box, chest minecart/boat) is open and the pointer hovers one\n  of **its** slots, the container is sorted instead. Furnaces, brewing stands,\n  crafting, smithing, enchanting and other interfaces with role-specific slots\n  are never sorted.\n* Compatible partial stacks are consolidated first (`42 + 10 → 52`,\n  `42 + 30 → 64 + 8`, `42 + 10 + 25 → 64 + 13`), respecting each item's own\n  max stack size (16 for eggs, 1 for tools). Existing stacks are topped up\n  before a new partial stack is left over.\n* Sorting an already sorted region is a no-op; repeated presses are stable.\n* Vanilla item locks are respected: a stack locked **in its slot**\n  (`minecraft:item_lock` = `lock_in_slot`) stays exactly where it is and the\n  rest of the region is sorted around it; nothing is ever merged into or out\n  of it. A stack locked **in the inventory** (`lock_in_inventory`) may still\n  change slots inside the player inventory, as vanilla allows; inside a\n  container it is left alone as well.\n* The Sort key is ignored while a text box is being edited (Creative\n  search, anvil name, ...), so typing an `r` never triggers a sort. The key\n  also does nothing while an item is held on the cursor.\n\nSorting is explicit only. Nothing happens in the background, and there is\nnothing to configure: the default order is the product.\n\n## What the result looks like\n\nOne press turns a mixed chest into these sections, in this order:\n\n1. **Shulker Boxes** – every box, whatever its colour, comes first. Boxes with\n   something inside come before empty ones. Named boxes lead, then boxes with\n   the same contents sit next to each other regardless of how the items are\n   arranged inside them, then colour. \"Same contents\" is judged the way the\n   inventory itself is ordered: an inner item's custom name, enchantments and\n   remaining durability count, so a box holding an *Efficiency V* pickaxe is\n   not the same as one holding a plain or a worn pickaxe. Only the box's own\n   items are inspected (vanilla never nests container items).\n2. **Gear** – tools, weapons, armour, bows, shields, elytra and the like, in\n   the game's own Creative order.\n3. **Items** – food, materials, potions, utility and miscellaneous items, in\n   the game's own Creative order.\n4. **Blocks** – building blocks, then natural blocks, in Creative order.\n5. Anything the game does not list in its Creative inventory (add-on or\n   custom items) goes last, in a stable identifier order.\n6. Empty slots.\n\nVariants of one item are kept together and ordered the same way every time:\ncustom-named ones first (by name), then enchanted ones (grouped by\nenchantment, higher level first), then plain ones; among damageable items the\none in better condition comes first. Stacks of one kind are placed biggest\nfirst, so a merged run reads `64, 64, 12`.\n\n## How it works\n\nThree concerns are kept apart:\n\n* `src/mod/sort/` is the pure planner and ordering vocabulary. It works on\n  synthetic slot states (count, max stack size, an opaque *mergeability\n  group* and an ordering key) and produces a list of *Move* / *Swap*\n  operations plus the expected final layout. It has no Minecraft dependency\n  and is covered by unit tests.\n* `src/mod/game/StackClassifier` turns real item stacks into planner input.\n  **Mergeability is decided by vanilla**: two stacks share a group only if\n  `ItemStackBase::isStackable(other)` — the check the game itself uses when\n  stacks are combined in the UI — says so. Damage, enchantments, names, lore,\n  components, container contents, `can_place_on` restrictions and every other\n  vanilla-relevant difference therefore keep stacks apart, exactly as the\n  inventory screen would. LaminaSort never defines its own equality.\n  The ordering key is a thin semantic layer over the game's own data: the\n  section comes from the Creative category of the item's registry entry\n  (Shulker Boxes and food are the only overrides), the position inside a\n  section from the Creative group and entry, and variant order from the\n  item's custom name, enchantment list (registry id order, level descending),\n  damage value and, for Shulker Boxes, a signature of the contents. That\n  signature is built from the inner stacks' own ordering keys (name,\n  enchantments, damage, ... but not nested contents), merged per kind and\n  sorted, so it does not depend on the internal slot layout. A Shulker Box is\n  recognised by the item's class (`ShulkerBoxBlockItem`), not by its name.\n  Item locks are read with the game's `ItemLockHelper`. A hash of the\n  remaining item data is used only as a last-resort tie-breaker.\n* `src/mod/game/SortSession` executes the plan through the screen's own\n  `ContainerManagerController`: a Move is `handlePlaceAmount` (the transfer\n  behind shift-click / drag placement) and a Swap is `handleSwap` (the\n  transfer behind the hotbar hotkey swap). Both go through the vanilla\n  `ItemStackRequest` path: the client predicts the change immediately and\n  the server validates the request afterwards. Before and after every step\n  the touched slots are compared with the planner's simulation of the\n  client-side prediction; any disagreement, a refused transfer or an item\n  held on the cursor aborts the remaining steps.\n\n  The server's verdict arrives asynchronously, after the whole sequence of\n  steps has already been issued, and is **not** fed back into the sort: if\n  the server rejects a request, vanilla itself discards the client's\n  prediction for that step and restores the server's slot contents, exactly\n  as it does for a rejected manual drag. LaminaSort only observes the\n  `ItemStackResponse` and logs a warning for each rejection (visible in the\n  log; a `--trace=y` build shows the accepted count too). It never retries,\n  re-plans or \"fixes up\" a rejected step. Since every step is an ordinary\n  validated transfer, the inventory is consistent whichever steps the server\n  accepted.\n\n## Configuration\n\nOn first start LaminaSort writes `mods/LaminaSort/config/config.json`:\n\n```json\n{\n    \"version\": 1,\n    \"sortKeyCode\": 82,\n    \"sortContainers\": true\n}\n```\n\n* `sortKeyCode` – default Windows virtual-key code for the Sort key (`82` is\n  `R`). It only seeds the game's keyboard settings; remap it in game.\n* `sortContainers` – allow sorting an opened storage container when its slots\n  are hovered. When `false`, only the player inventory is ever sorted.\n\nThere are no sorting profiles or ordering options; the default order described\nabove is the only one. The file is read once at mod load; restart the game\nafter editing it.\n\n## Installation\n\nDownload `LaminaSort-client-windows-x64.zip` from the\n[GitHub Releases](https://github.com/amatouhake/LaminaSort/releases) page and\ncopy the `LaminaSort/` directory it contains (`LaminaSort.dll` +\n`manifest.json`) into the `mods/` directory of a LeviLamina client\ninstallation (for a LeviLauncher instance:\n`%APPDATA%\\levilauncher.exe\\versions\\<version>\\mods\\LaminaSort\\`).\n\nThe repository also ships a `tooth.json`, so the release can be installed as\nthe LIP package `github.com/amatouhake/LaminaSort` where LIP / LeviLauncher\npackage installation is available.\n\nLaminaSort is early (`0.x`) software: it is usable, but its behaviour and\nconfiguration may still change between releases.\n\n## Building\n\nRequirements: [xmake](https://xmake.io), Visual Studio 2022 build tools, and a\nclang-cl toolchain (LLVM).\n\n```shell\nxmake f -y -p windows -a x64 -m release --target_type=client\nxmake\n```\n\nThe packaged mod (`LaminaSort.dll` + `manifest.json`) is written to\n`bin/LaminaSort/`; install that folder as described under\n[Installation](#installation). The `version` in the generated `manifest.json`\nis derived from the nearest `vMAJOR.MINOR.PATCH` Git tag (`0.0.0` when there\nis none).\n\nUnit tests for the game-independent planner:\n\n```shell\nxmake build LaminaSortTests\nxmake run LaminaSortTests\n```\n\nFor runtime diagnostics, configure with `--trace=y`; the mod then logs the\nselected region, the planned layout, every operation, the server's responses\nand text-box focus changes at debug level and mirrors them, flushed\nimmediately, to `mods/LaminaSort/trace.log` (appended across runs).\n\nBuilding against the LeviLamina SDK needs an LLVM that the SDK package can be\ncompiled with; the 26.51.x SDK was verified with LLVM 22.1.8 (`clang-cl`).\nIf the `levilamina` package fails to compile with the Visual Studio-bundled\nLLVM, put a matching LLVM `bin` directory first on `PATH` for `xmake f`.\n\n## Not in scope\n\nMove matching / move all, LaminaSort's own slot locking (vanilla item locks\nare honoured, see above), auto-restock, background sorting, inventory search\nor highlighting, custom sort profiles and any server-side component are\ndeliberately left out.\n\n## License\n\n[MIT](LICENSE) © amatouhake\n\nBootstrapped from the CC0-1.0 licensed\n[levilamina-mod-template](https://github.com/LiteLDev/levilamina-mod-template)\n"}],"gallery":[],"versions":[{"version":"0.1.0","prerelease":false,"released":"2026-09-20T16:48:33Z","releaseUrl":"https://github.com/amatouhake/LaminaSort/releases/tag/v0.1.0","manifestUrl":"https://github.com/amatouhake/LaminaSort/blob/v0.1.0/tooth.json","info":{"name":"LaminaSort","description":"Client-side inventory sorting and management mod for Minecraft Bedrock Edition, built on LeviLamina.","tags":["platform:levilamina","type:mod"]},"variants":{"client":[{"side":"client","platform":"win-x64","deps":{"github.com/LiteLDev/LeviLamina#client":"26.51.*"}}]}}],"dependencies":{"github.com/liteldev/levilamina":{"id":"github.com/LiteLDev/LeviLamina","name":"LeviLamina","owner":"LiteLDev","url":"https://levimc.org/mods/github.com/LiteLDev/LeviLamina/"}},"requiredBy":[]}