--- type: User Story title: "US-003: Sort containers and player inventory" description: Let players use a Sorting Stick to consolidate and organize supported storage or their main inventory. status: done --- # US-003: Sort containers and player inventory As a **player holding a Sorting Stick**, I want to sort storage containers or my main inventory so that related items are consolidated and organized automatically. ## Acceptance criteria - [x] Using the Sorting Stick on a chest sorts the complete chest inventory. - [x] Using it on either half of a double chest sorts the combined inventory. - [x] Using it on a barrel sorts that barrel. - [x] Using it without targeting a supported container sorts the player's main storage slots. - [x] Player hotbar, armor, and off-hand slots are not changed during player-inventory sorting. - [x] Compatible partial stacks are consolidated without exceeding item stack limits. - [x] Remaining stacks are placed in a deterministic, documented order. - [x] Sorting preserves item quantities and all item metadata exactly. - [x] Sorting respects cancelled interactions and normal container-access protections. - [x] Unsupported or inaccessible targets fail safely without changing an inventory. - [x] Sorting provides concise player feedback without opening the target container. - [x] Automated tests cover single chests, double chests, barrels, player inventory boundaries, stack consolidation, metadata preservation, and rejected interactions. ## Related - [US-002: Craft a Sorting Stick](us-002-craft-sorting-stick.md) - [User-story catalog](index.md)