ChestCleaner - Sorting Plugin (+API) 1.7

ChestCleaner sorts your chests and inventories. (+ Autorefill for items in the hotbar)

  1. tom2208
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    Source Code:

    Thank you for over 7000 Downloads!
    This plugin is made for cleaning inventories. What can you do with my plugin:
    - cleaning player inventory [available (v1.1)]
    - cofiguration file and commands [available (v1.2)]
    - an item you can use instead of the cc or cleanchest command [available (v1.2)]
    - ShulkerBox cleanable [available (v1.3)]
    - you can clean enderchests
    - Timer [available (v.1.4)]
    - SHIFT + RIGHTCLICK with the cleaning item to sort your inventory [available (v1.4.3)]
    - Blocks and Consumables like Food can automatically get refilled form your inventory into your hotbar [available (v.1.5.3)]
    - configure the plugin messages in the chestcleaner/config.yml [availavle (v.1.4.9)]
    - configure the lore of the cleaning item [availavle (v.1.5.1)]

    - blacklist for items that will be ignored by the sorting algorithm [availavle (v.1.6.3)]

    Only Spigot was tested with this plugin. If I have the time I will try to implement a support for paperspigot or alternative plugin.

    Please tell me your ideas/wishes for new functions and report bugs, so i can fix them. (Use the discussion section or private messages for that please)

    Using the cleaning item: Click on a block (with your cleaning item) with an inventory you are able to open, then you will get a message "inventory sorted" (you can change the text in the config) and the inventory gets sorted. You can sort your own (player)inventory by sneaking and right-clicking into the air (in this case you will get a "inventory sorted" message too).

    German explanation: Dieses Plugin ist zum sortieren von Inventaren, seien es Truhen, Endertruhen, Shulkerboxen, oder das eigene Inventar. Die Inventare können mit einem Kommando oder auch einem Item (CleaningItem) sortiert werden.

    (before and after (using the plugin version

    If you find this plugin useful and if you like to support me, click here: :)

    Do want to use this plugin as API? Just use the documentation on gitgub (and the current version of this plugin).

    Information: The default cleaning item is the iron hoe.

    For MC versions lower then 1.13 please use the version of this plugin (i will add the documentation for it soon, it got deleted by a spigot bug).

    Commands and permissions:

    -/cleaninventory : sorts the inventory of the block you're look on, if available. (has a range of 12 blocks, so if your too far away, form a chest or something else, it could try to sort an air block)
    permissions: chestcleaner.cmd.cleaninventory

    Timer command:
    -/timer setTime <time in seconds> : sets the time of the timer (is not activating the timer!).

    -/timer setActive <true/false> : activates or deactivates the timer.
    permission: chestcleaner.cmd.timer

    CleaningItem command:
    -/cleaningitem rename <name> : Rename the cleaningitem.

    Old cleaning items will not work anymore after changing there name to something else. (You can use color-codes like: &1, &5, .. just replace "§" to "&")
    Example: /cleanitem rename mc cleaning item

    permission: chestcleaner.cmd.cleaningitem.rename

    -/cleaningitem setlore <lore> : Sets the lore of the cleaning item (thats a text you can see if you hover over the item)
    Old cleaning items will not work anymore after changing there name to something else. (You can use color-codes like: &1, &5, .. just replace "§" to "&")
    permission: chestcleaner.cmd.cleaningitem.setlore

    -/cleaningitem setitem : Sets the cleaning item to the item you're holding in your main hand.
    permission: chestcleaner.cmd.cleaningitem.setitem

    -/cleaningitem get : Gives you a cleaning item.
    permission: chestcleaner.cmd.cleaningitem.get

    -/cleaningitem give <playerName/@a> : Gives the a cleaning item to a player or to all player with '@a'.
    permission: chestcleaner.cmd.cleaningitem.give

    -/cleaningitem setActive <true/false> : Activates or deactivates the functionality of the cleaningitem. (watch out: if you have the permission "chestcleaner.timer.noeffect" or if you're operator, the timer will have no effect on you)
    permission: chestcleaner.cmd.cleaningitem.setactive

    -/cleaningitem setDurabilityLoss <true/false> : "True" activates that your item will get damage or its amount get reduced by one if its is stackable like iron, if you're using it to sort. "False" deactivates it.
    permission: chestcleaner.cmd.cleaningitem.setdurabilityloss

    -/cleaningitem setEventDetectionMode <true/false> : Activates or deactivates the event-detection-mode.
    If this mode is active the plugin will get the inventories if your opening an inventory, as a player, while holding your cleaning item. Thats usefull if you dont want other players to sort the chests of others, because you will only be able to sort inventories you are able to open. The disadvantage is: that method has some confilcts with other plugins, inventory that are opened by other plugins will get sorted.

    For that case i have implemented a iterator method (that will be active if the eventDetectionMode is set to false), that means the plugins uses the block the player is looking on, like the command cleaninventory. The problem is, players are able to sort every chest.
    permission: chestcleaner.cmd.cleaningitem.seteventdetectionmode

    sorting = the blacklist of the materials (item types) that get ignored stacking while sorting

    inventories = the blacklist of materials (block types) that get ignored if you want to try sorting an inventory of a block. (only works for "EventDetectionMode = true" mode)

    -/blacklist <sorting/inventories> addMaterial : Adds the material of the item you are holding to the blacklist.
    permission: chestcleaner.cmd.blacklist

    -/blacklist <sorting/inventories> addMaterial <material>: Add the material to the blacklist.
    permission: chestcleaner.cmd.blacklist

    -/blacklist <sorting/inventories> removeMaterial : Removes the material of the item you are holding from the blacklist.
    permission: chestcleaner.cmd.blacklist

    -/blacklist <sorting/inventories> removeMaterial <index/material>: Removes the material (if you want to use the index take the number of the material form the /blacklist list) from the blacklist.
    permission: chestcleaner.cmd.blacklist

    -/blacklist <sorting/inventories> list: To get the blacklist displayed.
    permission: chestcleaner.cmd.blacklist

    -/blacklist <sorting/inventories> clear: Clears the blacklist.
    permission: chestcleaner.cmd.blacklist


    Sorting Patterns: A sorting pattern is the way how the algorith puts the items into the inventory. Here are the 4 exisiting patterns:





    Sorting Evaluator: The evaluator is the way how the items are


    ID: BACK_BEGIN (top arrangement)
    Sorts the items alphabetically beginning with last character.

    ID: BEGIN_BACK (bottom arrangement)
    Sorts the items alphabetically beginning at the first character.

    - /sortingconfig pattern <PATTERN_ID> : Sets the sorting pattern of the player performing this command. It will not effect other players.
    permission: chestcleaner.cmd.sortingconfig.pattern

    - /sortingconfig evaluator <EVALUATOR_ID> : Sets the evaluator of the player performing this command. It will not effect other players.

    permission: chestcleaner.cmd.sortingconfig.evaluator

    - /sortingconfig setautosort <true/false> : Activates or deactivates the auto sorting (automatically sorting chests after closing it).
    permission: chestcleaner.cmd.sortingconfig.setautosort

    - /sortingconfig adminconfig setdefaultpattern <PATTERN_ID> :
    Sets the default sorting patter, that gets used if the player sets no preverence with /sortingconfig pattern.
    permission: chestcleaner.cmd.sorting.config.admincontrol

    - /sortingconfig adminconfig setdefaultevaluator <EVALUATOR_ID> :
    Sets the default evaluator, that gets used if the player sets no preverence with /sortingconfig evaluator.
    permission: chestcleaner.cmd.sorting.config.admincontrol

    - /sortingconfig adminconfig setdefaultautosort <true/false> :
    Sets the default activation of auto sort, that gets used if the player sets no preverence with /sortingconfig autosort.
    permission: chestcleaner.cmd.sorting.config.admincontrol

    Other permissions:
    - chestcleaner.cleaningitem.use : You need that permission to use the cleaning item for sorting.

    - chestcleaner.timer.noeffect : If a player has that permission, he/she will be able to sort inventories so many time he/she want per time, that means the timer will have no effect on that player.

    - chestcleaner.autorefill.consumables : That permission allows you to get your consumables autorefilled into the hotbar or extra-slot.

    - chestcleaner.autorefill.blocks : That permission allows you to get your blocks autorefilled into the hotbar or extra-slot.

    - chestcleaner.update : If you have that permission, you will get a message if this plugin has new update available.

    - chestcleaner.cleaningitem.use.owninventory : Allows you to sort your own inventory by right clicking and sneaking while you're holding the cleaning item in your hand.

    You can set cleanInventorypermissionactive = false in the config. On this way you deractivate the permission for the cleaninventory command.

    By setting consumablesrefill or blockrefill to true or false, you can activate or deactivate that feature.

    If you are an operator (/op <name>) you have every permission among others "chestcleaner.timer.noeffect", because of that the timer will have no effekt on you, as an operator, if you have actived it. (So just dont wonder, it will work for your other useres)

    You can select a craftable or stackable item for your cleaning item. If you do so players can craft their items themself, using sources to "pay" for the sorting, like the gold for the golden hoe.
    If you pick a craftable item for example a gold nugget, then the item gets removed from your inventory, like you're "paying" an item, in my example a gold nugget.


    Code (Java):
    defaultautosort: false
    defaultevaluator: BACK_BEGIN_STRING
    defaultsortingpattern: LEFT_TO_RIGHT_TOP_TO_BOTTOM
    - Syntex Error
    - Error
    - I'm sorry, but you do not have permission to perform this command.
    - You can sort the next inventory in %time seconds.
    - The block at the location %location has no inventory.
    - Inventory sorted.
    - There is no world with the name "%worldname".
    - You have to be a player to perform this Command
    - '
    Timer: true'
    - '
    Timer: false'
    - '
    Timer: %time'
    - '
    The name of your new cleaning item is now: "%itemname§a"'
    - Cleaning item lore was set.
    - '
    %newitem is now the new cleaning item.'
    - You have to hold an item to do this.
    - You got an cleaning item.
    - '
    Cleaning item: true'
    - '
    Cleaning item: false'
    - The player %playername got a cleaning item.
    - Player %playername is not online.
    - '
    OpenInventoryEvent-DetectionMode was set to: %modeBoolean'
    - A new update is available at:§b
    - '
    DurabilityLoss: true'
    - '
    DurabilityLoss: false'
    - The material of the item "%material" was added to the blacklist.
    - The material "%material" was removed form the blacklist.
    - The blacklist does not contain the material "%material".
    - Index is out of bounds, it have to be bigger than -1 and smaller than %biggestindex.
    - The blacklist is empty.
    - '
    The BlackList page %page:'
    - '
    For the next entries: /list %nextpage'
    - '
    Invalid input for an integer: %index'
    - '
    Invalid page number (valid  page number range: %range)'
    - There is no Material with the name "%material".
    - The blacklist was successfully cleared.
    - The material %material is already on the blacklist.
    - This Inventory is on the blacklist, you can'
    t sort it.
    - There is no pattern with this id.
    - Pattern was set.
    - There is no evaluator with this id.
    - Evaluator was set.
    - Autosorting was set to %boolean.
    - New default sorting pattern was set.
    - New default evaluator was set.
    - Default auto sorting was set to %boolean.
      ==: org.bukkit.inventory.ItemStack
      v: 1963
      type: IRON_HOE
    active: true
    durability: true
    openinventoryeventmode: false
    consumablesrefill: true
    blockrefill: true
    cleanInventorypermissionactive: true
    % indicates a variable, for something like time or a player etc. Use them like they are, only in the same line and with the same spelling. (My plugin replaces the charsequence "%variable" to the specific information like the timer or something else)
    No whitespace behind the lines. "true " -> "true"
    If you failed by editing the config.yml, just delete the ChestCleaner folder in the plugin folder and restart or reload the server.

    You can disable (by perssions) the command function for players, then they can't sort other players (protected) chests. They can only sort there own inventories (inventories they can open) with the cleaning item then.


    1. 2017-05-01_14.06.55.png
    2. 2017-05-01_14.07.52.png
    3. 2017-05-01_14.08.54.png
    4. 2017-05-01_14.09.39.png
    5. 2017-05-02_18.58.51.png
    6. 2017-05-02_18.59.22.png
    7. Bild.gif

Recent Updates

  1. Version 1.7
  2. Fixxing log-Bug
  3. Update 1.6.4

Recent Reviews

  1. Ve6om
    Version: 1.7
    Works great, love it. Keep the updates coming please :) Glad to see them so frequent
    1. tom2208
      Author's Response
      Thank you! <3
  2. MrAmericanMike
    Version: 1.6.4
    Great Plugin. Only thing I couldn't find in the documentation is what's the permission that needs to be added for regular players to be able to use it.
    1. tom2208
      Author's Response
      Thank you for the 5 Stars! Im not sure what you're meaning. If you need the permission for players to use the cleaning item that is: chestcleaner.cleaningitem.use
      You can find that in the documentation under "other permissions".
  3. lolbob
    Version: 1.6.4
    Unfortunately no paper 1.14.4 Support for the item give @p.
    Auto Clean after closing is missing too.
    Hot Keys are missing to.
    The command works though.
    I dodged on another plugin
    More sorting styles in the chest direct selectable would be nice.
    1. tom2208
      Author's Response
      Thank you for your ideas and your 4 Stars! I will add those things in the future.
  4. Column01
    Version: 1.6.4
    Very good plugin. Saved me many headaches sifting through chests to find items I wanted. Keep up the good work!
    1. tom2208
      Author's Response
      Thank you!
  5. suwako99
    Version: 1.6.3
    five stars!
    but there has some bugs:
    after ChestCleaner works on chest,
    if has some stone,panel,other blocks
    player get more stone ,panel and other blocks in chest
    (test version:paper spigot 1.14)
    1. tom2208
      Author's Response
      Thank you for the five stars! :)
      But im sorry, i only developed the plugin for spigot, there are ofter bugs with paperspigot. If i find some time in the future i will implement a support for paperspigot.
  6. Flip
    Great Tool !! Thanks a lot. !!

    One little question. What is the permission for cleaning the one inventory with "SHIFT+RIGHTKLICK" ?

    Thanks a lot :-)
    1. tom2208
      Author's Response
      Thank you!
      I just forgot to implement that correctly in the new version 1.6 and greater ^^'. Thank you for reporting, i will care about that. Next time just use the discussion section or private messages please.
      ~ Tom
  7. victoret7
    This plugin is a beast, easy and fast to use. Would love to see an update for the 1.14.1
    1. tom2208
      Author's Response
      Thank you :). Im reworking the whole Plugin, means new code etc, it will work on 1.14.1 too.
  8. SirMaurice
    Nice work you did there, BUT there is one problem that is really annoying, i cant disable the permissions.
    Its a real problem, my users cant sort their chests and inventories, could you make an option in the config to disable the permissions? Or add an option what people can do without being operator.
    Your doing a great job, keep it going.
    1. tom2208
      Author's Response
      Thank you, good idea. I will rework the whole plugin soon and i will add this feature then.
  9. lightPlugins
    Works with 1.13.2. But there are missing translation lines in the config.yml. You cannot translate all
    1. tom2208
      Author's Response
      That changed in the new version 1.6.
  10. T43DiamondGamer
    Great Plugin. Has helped me a great deal. Would be even better if you could bind the commands to an item e.g. a stick (wand). Click chest with stick and it sorts it for you.
    1. tom2208
      Author's Response
      Thank you for the five stars,
      this item fuction thing is allready implemented. Just use the golden hoe.
      ~ Tom