Prevent

Prevent 1.0

Native Minecraft Version:
1.18
Tested Minecraft Versions:
1.18
Overview
A simple plugin serving as a quality of life addition. If a player is to break an item, then it will be saved in the player's personal vault as long as the item is whitelisted in the config.yml file. The items that are whitelisted by default are all netherite tools and armor but this can be changed in config.yml.


Commands
A list of commands available to Player type senders, accessible using the prefix /preventtoolbreak or /ptb.

vault
Displays a message to the player the count of items are stored in their vault. Upon hovering the message, the player will be also able to see the name of each item in their vault.

Note: An upcoming update may feature the ability to preview an item's enchantments and/or custom name upon hovering

recover
If items are in a player's vault then this command will retrieve them. If there is no room in the player's inventory to receive the items, the command will be rejected.

Note: A known issue is that if you have 36 or more items in your vault, then you will never be able to retrieve the items and the plugin will become useless for that player. This will be addressed in the next update but for now a work-around is to save half of that player's vault externally and let them recover their items before returning the 2nd half, although this scenario is extremely unlikely given the default config.


Files
config.yml
whitelist: Any item can go into this list, the only ones that count however, are tools and armor. Adding an item to this list will allow the item to be recoverable after breaking. Each item in the list must use its Material name, the item may not be processed otherwise.

Note: In a future update, I might include the option to add blanket whitelist items that cover entire collections of items by material or tool.

data.yml
data: Stores UUID/List<ItemStack> key-value pairs representing recoverable broken items belonging to a specified player UUID. The data in this file is written on plugin disable, and read on plugin enable. Killing the server instance may cause unwanted issues (new key-value pairs not writing to file).
Author
Mined
Downloads
6
Views
33
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Mined

Top