Per Bag Sort sorts the contents of a single bag at a time, without ever moving items into a different bag. Unlike a typical "sort all bags" function, each bag stays self-contained — what you keep in your backpack stays in your backpack, and what's in bag 3 stays in bag 3.
Items are grouped by type and subtype first (so all your Cloth sits together, all your Ore sits together, and so on), then ordered by item level within that group, highest first. This keeps related materials clustered together instead of scattered by arbitrary item ID.
Commands:
/pbsort 0through/pbsort 4— sort a single bag (0 is your backpack, 1–4 are your equipped bag slots)/pbsort allor/pbsortall— sorts every bag in sequence, one at a time
Sorting happens gradually rather than all at once, to stay in sync with the game client and avoid partial or interrupted sorts.
This is a simple project I did for myself. Just wanted to share to others.

