You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

31m 29s logged

Today I added a simple inventory sorting command to my Paper Minecraft plugin. The command /sortinv sorts only the players main inventory while keeping the hotbar untouched. (i never did these item rearranging things in the inventory so it was complicated at first)

The implementation collects all items from the inventory, clears those slots, sorts the items by material name, and then places them back starting from slot 9. It’s a pretty basic approach but it works reliably and keeps the code easy to understand. Also, i need to fix that individual items stack together and i will maybe not only sort by alphabet but by item category.

0
2

Comments 0

No comments yet. Be the first!