DropProtect
Please note: I am not actively maintaining this project. However, it is open-source, so feel free to fork the repository on GitHub and keep releasing for the newer versions of Bukkit. I designed it to not be fragile, so this should be easy :)
DropProtect
Don't want your players losing their entire inventory on death? DropProtect protects your equipment and hotbar slots, while allowing the inner inventory to drop as normal. You may configure it to reduce the number of protected hotbar slots or add additional protected inner inventory slots to suit your server.
Personally, I find the default of 9 (all armor + 9 hotbar slots) to be the sweet spot between losing it all and having no penalty on death. Still penalize them for dying, but don't make them rage if they get a lag spike and fall into lava with their enchanted diamond set.
Download
- DropProtect v0.4 (JAR file) for Bukkit 1.7.2+
Example (with the default setting of 9 protected slots)
Inventory before and after death. The purple highlight (in this image only) indicates protected slots:
And here's what we've left behind:
Source Code
DropProtect is open-source. You can view the source code on GitHub!
Simple Drop-in Installation
Place the DropProtect.jar file into your /server/plugins folder. Start the server.
Run /dropprotect to make sure it's installed correctly.
Commands
/dropprotect will display which slots are protected. It looks like:
Configuration
After running the server once with DropProtect installed, the config file /server/plugins/DropProtect/config.yml will be created.
You may change the protected-slots setting to your liking. There are some examples inside the file. You can run /reload or restart the server to apply the config change.
Permissions
As of v0.4, you can assign a different number of protected slots based on permissions that a player has.
This is what your /server/plugins/DropProtect/config.yml file can look like:
protected-slots: 3 # default if no permissions match
permissions:
- dropprotect.diamond: 8
- dropprotect.platinum: 7
- dropprotect.gold: 6
- dropprotect.silver: 5
- dropprotect.bronze: 4
Put them in the highest-first order since it matches from the top. Once it finds a match, that's the value it uses.
Also, those dropprotect.xxx names are just an example. You can call it whatever you like, and the dropprotect prefix is optional. You will need a system in place to assign these permissions to your players, but this is outside the scope of the plugin.
Fan Videos
Compatibility with other plugins
DropProtect accesses the player's inventory on death and respawn events. If your server has other plugins that do the same, make sure to use DropProtect v0.3 as it has been fully redesigned to be as compatible as possible with other plugins.
Verified to be compatible with:
- MobArena v0.95.5
- xAuth (must have hide-inventory OFF or xAuth will wipe the player's inventory)
Issues and Bug Reports
You can open a new issue on GitHub.
@pavben
Great :)
I think, permission for armor will be great too :)
@pavben
That'll work perfectly! xD
@pavben I would personally like the plugin to do it but have an option to change the amount based on how many slots or something. so like maybe /dp buy 24 100 so like dp the command you buy 24 slots for 100 dollars making the cash configurable for each slot or a configuration saying 200 per slot and an additional X amount of money to save per armor slot. Just an idea. Do it as you want.
I understand that there's some interest in being able to configure the number of protected slots based on permissions. If I made the configuration like this, would it satisfy your needs perfectly?
Then it will check the highest permission the player has that matches, and use that value for the player. Even if you mistakenly added both dropprotect.rank1 and dropprotect.rank2 to one player, rank2 would count because it is lower in the list.
Do you use plugins that allow you to charge someone a fixed economy dollar amount to acquire a new permission? If so, you would be able to use this along with the above config to charge players for upgrading the protected-slots. Your other plugin would charge them the economy $ and add dropprotect.rank2 (or whatever permission you choose) to the player. Basically, I want to know if this is natural for you to set up or if you would prefer to have DropProtect handle the economy too, not just permissions.
@pavben
You could set in the configuration file specific permissions with a configurable cost for a certain slot setup, so for say default group can keep the first 3 items in their inventory by default for free, but then they can purchase another set if they have the correct permissions that gives them the first 6 slots etc. Something like that maybe? So Donators and VIPs etc have the option to protect more slots or something.
great plugin woald be nice if you made new logo
After readiong the comments, I agree that preserving items in slots should have a standing in the economy. If you have something in those slots you want to keep, you should be ready to pay for it. I also would like to see people of certain ranks have different slot amounts and costs. I have a server that has nearly 20 free ranks, but I don't want low ranking users keeping many things when they die, as I have a prestige system established.
@pavben Just make someone have to pay for the slots i suppose.
@Rymzy /\ Look into the description, where is "Download" /\
how do i download it ?
@pavben I just tested it with MobArena and works fine ;)
Simplicity is perfect, keep it as it!
Tested with xauth too, but if
- I die
- and not respawn and logout (session have to expire)
- and in config is hide-inventory set to true
I got inventory just when join. After i logged in, inventory was replaced to zero.
If you want to solve this, please try don't use MoveEvent, it's laggy sometimes.
Edit: I want use inventory recove only to VIP, not players, so make permission note, please :)
Thanks, guys! I'm already working on DropProtect v0.3 in which I'll be focusing on compatibility with as many other plugins as possible.
@DJTomek I've looked into the MobArena source code and it should already work fine with DropProtect v0.2 because MobArena revives the player without allowing for the PlayerRespawn event to be emitted. Either way, I'll make sure DropProtect v0.3 is perfectly compatible with MobArena.
@Elvisapresley I could, but I need to be convinced that these are popular scenarios to avoid overcomplicating the plugin. One of the goals I'm going for is simplicity. Could you elaborate on what you mean by making it economy based?
Your plugin made my players so happy!
Wonderful Plugin, i love it very much. I don't want to feel ungrateful or anything. Can you make economy based and make the armor optional? Once again it is wonderful.
Save inventory in Mobarena too? If yes, it isn't useable for some servers. (I can't test it now)
Can you provide the download link please
@Jukkatibbs
I've edited the description text to make it clear that the purple highlight isn't shown in-game. Thanks for pointing it out. Highlighting the slots on the client would involve a client mod, which is certainly doable if there's enough demand for it, and I think that could look pretty sweet. Probably not purple, but something that fits nicely with the default resource pack :)
I'll consider making the slots configurable in the near future.
Edit: I've made the slots configurable in v0.2. Waiting for the release to be approved.
Will the item slots be purple on the players client? You could maybe make a toggle-able amount of spaces to be protected as well. Say instead of the hotbar and equipment, make the first 3 in the inventory protected as well? :O Have a custom config / yaml, for the inventory spaces. like all 36 inventory + Armor slots, or just like the top row in the inventory + Hot bar and Armor slots. Ya know. I am interested in this one quite a bit. Happy Gaming! Tibbs~