A chest and inventory sorting plugin that should be future proof to minecraft updates.
SortSmith
I was sick of needing to update my sorting plugin each time minecraft updates (or waiting for a good one to release an update), so I made one with the features I like with no reference to any version specific requirements. It should in theory be future proof.
Features:
- Sort chests, barrels, shulker boxes, and ender chests (can be configgured which containers)
- Auto put all items into a container from your inventory that are already in the container
- Auto take all items from a container into your inventory that are already in your inventory
How To:
To sort, just double click a blank slot in a container, or in your inventory. Thats it, there are no other ways to sort (for now).
To auto put items, left click outside the inventory UI.
to auto take items, right click outside the inventory UI.
How it Sorts:
The sorting algorithm had to figure out how to sort without any hard coded categories or item lists. But, it is not just a dumb simple sort alphabetically. So what it does is it grabs item tags which Bukkit/Paper provide and should forever provide I presume. An item can have multiple tags on it, like a diamond sword can have weapon, enchantable/weapon, swords, enchantable/durability, enchantable/sharp_weapon, etc. When the plugin loads with the server, it will rank each tag based on a combination of how many items have that tag and on average how many tags each item has. I did this because there were some tags like decorated_pot_sherds which had more items in it than swords, but I thought swords are more important than pot sherds. the swords had a lot more tags they were part of so they were weighted higher. if there are any items which are tied by ranking this way, it then will fall back to alphabetical. One thing to note, it seems there are lacking tags around any food, or potions or whatever. there seems to be quite a lot of items that have no tags so get sorted at the end alphabetically. Also, I sorted out any tag that had the name of any mob in it since there were lots of tags that were like sulfur_cube_consumable (which had a lot of items in it) and piglin_preferred_weapons (which I don't care about).
Notes: There are no commands or in game UI (yet). No per player config or permissions. There is a very basic config: just double click time and which containers should be able to be sorted.
Here is the config defaults for reference:
# Maximum time between the two clicks used to trigger sorting.
# Time is in milliseconds.
sort-double-click-time: 300
# Containers that SortSmith will sort.
# These names come from Bukkit/Paper inventory types.
sort-containers:
- CHEST
- BARREL
- SHULKER_BOX
- ENDER_CHEST
Sub Note:
This is my first time making a plugin, or coding in java for that matter, but I do have experience coding in general, and I have AI. Honestly, I thought I might just use this for myself and not upload this here, but decided it was actually good enough others may want this. There is a good chance I will not even respond to any suport requests or questions as I made this account just for this, and might not ever check it after I upload.
Information
Pinned Versions
- R26.1–26.3
Pages
Members
1Owner