SavageDeathChest
Description:
This plugin stores a player's inventory in a chest on death for later retrieval. It has many options, but configuration and use has been kept as simple as possible.
Features:
- Places a single or double chest at player's death location containing the player's inventory
- Optional sign placement on chest, showing player name and death date
- Configurable list of block types that chests can replace
- WorldGuard, GriefPrevention, PreciousStones and Towny aware, will not place a chest where the player does not have access. Enabled individually.
- Option to check protection plugins on chest access. Enabled individually, disabled by default.
- added WorldGuard 7.0 compatibility.
- Searches a configurable distance from death location to find a suitable chest location
- Optionally require players to have chest(s) in inventory
- Chest protection allows only owners access. Also makes chests explosion proof!
- Optionally allow player's killer to access their chest, for pvp looting.
- Prevent concurrent access to chests when killer looting is enabled.
- Optional quick-loot feature allows one click (sneak-punch) chest looting
- Configurable expiration time for death chests, at which point they will break and drop their contents
- Custom messages and language localization
- Per world enabled in configuration
- Uses sqlite for persistent storage
- Prevents creative mode players from opening death chests
- Optionally prevent players from placing items in death chests
- Optional sound effects!
- A perfect compliment to SavageDeathCompass and SavageGraveyards
Permissions:
Permission | Description | Default |
---|---|---|
deathchest.player |
Default player permissions | true |
deathchest.chest |
Enable death chests for player. | true |
deathchest.loot |
Allows player to quick-loot death chests by sneak-punching. | true |
deathchest.doublechest |
Allows placement of double chests if necessary. | true |
deathchest.admin |
Default administrator permissions | op |
deathchest.freechest |
Overrides require-chest configuration setting. |
op |
deathchest.creative-access |
Overrides creative mode chest opening restriction. | op |
deathchest.loot.other |
Allow player to loot other player's chests. | op |
deathchest.reload |
Allows use of plugin reload command. | op |
deathchest.list |
Allows a user to view a list of their death chests and locations. | op |
deathchest.list.other |
Allows a user to view a list of other players death chests and locations. | op |
Commands:
/deathchest list [username]
Displays a list of player's death chest locations. Requires deathchest.list permission. If a player has permission deathchest.list.other, they can supply a username to list another player's deathchests, or type an asterisk (*) to list all deathchests.
/deathchest reload
Reloads configuration file and messages. Requires deathchest.reload permission, which is child node of deathchest.admin.
/deathchest status
Displays version info and some config settings. Requires deathchest.status permission, which is child node of deathchest.admin.
/deathchest help [command]
Displays a brief help message and command usage.
Installation
Put the jar in your plugins folder and restart your server. Edit the generated configuration file to your liking, then reload the plugin settings with the /deathchest reload
command. No server restart necessary!
Configuration
All configuration changes can be made without needing to restart your server. Just issue the reload command when you are satisfied with your settings in config.yml.
Source
Source code for this plugin is hosted on github and distributed under the GPLv3 license.
https://github.com/tim-savage/SavageDeathChest
@ThisUsernameIsMine
Yes, preventing creative players from giving away items to survival players (including themselves) is important. It sounds like my plugin is overriding GameMode Inventories check to prevent creative players from opening the chests. I will address this issue in the next version- thank you for bringing it to my attention.
Hi.
I use a plugin named GameMode Inventories to have seperate inventories for both survival- and creative gamemode.
Players who are in creative gamemode aren't normally able to open containers or drop items, but i've noticed that i'm able to open my protected chest and sneak items from creative to survival. This opens the ability to give away items to survival players.
Is there a way to fix/workaround this somehow? (chest-protection is enabled/true)
Thanks for the otherwise epic/awesome plugin! :-)
A new version has been uploaded that fixes the adjacent chest bug. Thank you TacoGerbil for finding and reporting this bug!
@TacoGerbil
Ok, I've done some testing, and it seems you've uncovered a bug where death chests being placed adjacent to existing chests may end up being placed in an 'illegal' triple-chest configuration. In my testing, the third chest was still there, but rendered invisible by the client. I was still able to open it and retrieve its contents, but the inventory displays of all involved chests were a little messed up too.
I'll need to take some time to restructure my valid chest location testing algorithm to take into account adjacent chests. It is already a fairly intense operation, potentially testing over 1,000 blocks in the worst case scenario using the default distance of 5 blocks. I'd really hate to have to multiply that by four to test each adjacent block, or potentially six or eight in the case of double chests. Perhaps matrix calculations or graph theory is necessary here, but I'm not well versed in these areas of mathematics, so It will take a little studying on my part.
At any rate, be patient, a fix is on the way. In the meantime, if this situation arises try checking adjacent blocks for an 'invisible' chest.
@HashBr0wn
Agreed. I'll see what I can do for the next version. Hopefully I can un-cancel the event or otherwise work around the respective protections for death chests only, and then add that as a configurable option for maximum flexibility.
Sidenote: I originally developed this plugin for my own use, specifically because I was tired of 'can you get my stuff out of my chest on somebody else's plot?' So that was the reasoning behind checking if they have chest access at their death location, and not deploying a chest if they don't. And some people were using death chests as a form of grief in places they were restricted from building. One of the other plugins I had tried would even replace blocks with the chests or gravestone markers, so griefers were able to damage structures using it. (And to be fair, it would happen by accident as well.)
@timsavage
Having an option in the config that allows people to use their death chests in worldguard or faction protected land seems like the best option to me, as long as they can't use other chests.
@HashBr0wn
Ok, that makes sense. Putting it another way, you'd like to override factions protection for the death chests only.
It might be possible to do this without the use of a command, by un-cancelling the block break event that is being cancelled by factions (or other protection plugins). The reason I would prefer that over having a command is because players can have multiple death chests, and allowing some method for the player to select a specific chest starts to get overly complicated. To keep it simple, the command would have to break all of a players death chests, which may not be ideal either.
Let me think about the best way to accomplish this. If I don't come up with a better method than the command, I'll give that a try.
@timsavage
I still want people to have deathchests in protected areas, but with this command they would be able to break them. The main use for this is factions.
@timsavage
What I meant is that the items were placed inside the chest on my death... I was killed again as I was about to retrieve my chest; but my first chest was replaced by the second chest; after I made it back to open what I expected to be my original chest, everything I had was gone.. Only the seeds I had apparently picked up while on my way to pick up my chest were in the chest that was placed down the second time. So technically it did what it was supposed to.... It just did it over my previous chest.
@TacoGerbil
Deathchests will not replace any block type that isn't configured as a replaceable block. Configuring chests or other inventory holder block types as replaceable blocks would be ill advised.
Can you upload your configuration file, perhaps there is an error. Also, any errors on the console, either at startup or during the event if applicable.
Adding a feature to store previous inventories would be beyond the scope of this plugin.
@HashBr0wn
This is possible, but can you explain the intended use? It's actually more complicated than it sounds, and would likely require changes to the database schema. If I do implement the feature, I'd like it to be as useful as possible to all users of the plugin. Thanks! (Also, I assume you are aware that players with deathchest.admin or deathchest.loot.other permission can break other players chests.)
How about a way to recover stuff that was previously lost like in my situation? A recovery mode option? Maybe saves the last 5 deaths and the admin can request a certain one be respawned for the player in front of the Admin?
Is there a way to put in a check whereby it checks for a previous chest? I just lost EVERYTHING I had... resource intensive stuff that took a couple weeks.... I died near my bed, respawned and was killed as I was trying to get to my stuff, the new chest (with some seeds I apparently walked over and picked up on my way to the deathchest) right over the area of the previous chest...... It's happened before but not with this kind of impact.
Can you add a command that breaks your chest for you?
Like /deathchest break
(I need this for many reasons)
@wiedzmin137
Version 1.2 now has optional Towny support. It should not place a chest at a location that the player does not have chest use permission.
@bobeeb
This error should no longer occur, but if it does it will be handled more gracefully, with a one-line log message. I think this was possibly being caused by a bukkit bug, but I've refactored my code for better compatibility, and in the worst-case scenario, it will just leave the sign off and print the short error message to the log.
@bobeeb
Thanks for the report. I will have a look and try to get a fixed version out asap.
got this error today
@wiedzmin137
For now, I intend to keep the plugins separate, for those who would prefer to have only the features of one or the other on their server.
Adding support for additional protection plugins is definitely something I'm amenable to. As long as there is an API that allows me to query a player's chest permissions at a given location, adding support should be relatively straightforward.
Can you merge SavageDeathCompass into 1 SavageDeath plugin instead? Also comatibility with Towny would be nice.
For current features - they are awesome.
Ok, the chest protection feature should be working as advertised now. I inadvertently introduced some bugs when I added the killer looting feature at the last minute. If you discover any more bugs, please let me know so I can squash them.