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
@Eriaqq
Thank you for the bug report. I'll work on getting a fixed version out as soon as possible. And thank you very much for the translation, I will include the file in the next version as well.
Hello, First congratulation for this great plugin. But there are some erros when i'm using "/suicide" (from essentials) I'm using Spigot 1.9.2. Fortunately this the only error I have :P -> http://pastebin.com/h8WxThqD
To help you in your work, I translated all the strings in French, feel free to include it in your plugin :) -> http://pastebin.com/uYAaMHc5
@ShamanCrinitus
Sorry for the late reply, I missed your comment when it was posted. I'll do some testing and see what I can find. Chests should definitely work in nether and end worlds.
Hey, I just installed this plugin on a Spigot 1.9.2 server and started testing it a bit. Works great in the overworld, but whenever I die in the nether or the end, the chat gives a message, "You had no inventory to place in a death chest," even if my inventory has lots of stuff. I respawn with all of it still in my inventory, which of course removes the challenge of having to go back to the nether/end to get my items back from the middle of a lava ocean or just above the void, etc. I have gamerule keepInventory set to false, so that shouldn't be conflicting with it, or at least I wouldn't think so.
I've tried specifically enabling my world called Savanna, Savanna_nether, and Savanna_the_end in the enabled worlds list, even though they shouldn't have been disabled because they weren't listed in the (now commented out) disabled worlds list. I also tried changing the search radius from 5 to 10, didn't notice any performance impacts, but it still didn't allow chests to spawn in the nether or the end (didn't think it would, but I tried it anyway). It's not just from lava or void either - any death from any source fails to spawn a chest in both non-overworld dimensions.
I was a little concerned because nobody had seemed to have this issue yet in the comments. Any idea how I might be able to fix this, or what might be causing it on my end? Some more details, I am running no other plugins at all, and I have two command block programs, one which ticks the time forward with only one player sleeping, and another which makes the ender dragon drop bonus stuff each time it's killed.
Edit: I've also made sure to /deathchest reload every time I change settings, and I've even restarted my server, but still no nether/end death chests.
@timsavage
I was thinking of idea very similar to this actually!
My idea was that when a player dies their inventory gets moved to a GUI instead of a chest. the player can then run a command to retrieve the items and pay for each item at a defined cost. The command would expire a certain amount of time after death and whatever was not paid for being deleted.
Probably an idea for another plugin that may be possible for you to make or even add as an option into this plugin.
But for now I think paying for chests is a good idea too :P
@oldjollysanta
I think this would be feasible. I'll try to work that into the next release. I don't have a projected date for the next release, but I'll try to get to it after I finish up the current project I'm working on.
I run a economy based server, is it possible to add support for vault to cost money to create a chest? Atm I will probably just setup a cost to add the permission using serversigns, so a one time purchase, but would be nice to charge per deathchest.
@puckman1971
Glad you got it working. I see you've got Factions and Grief Prevention support enabled, perhaps you were in a location that you didn't have the requisite permissions for a chest to be deployed?
@timsavage
Ok, I feel stupid, the 2nd time I killed myself it started working, tested several times and all is fine now! Thanks!
@timsavage
Ok, reloaded after renaming the old config folder, this gave me a brand new config. Below is console, no errors.
20.03 05:03:53 [Server] INFO [SavageDeathChest] GriefPrevention version 14.0 detected. 20.03 05:03:53 [Server] INFO [SavageDeathChest] Factions version 2.8.7Beta detected. 20.03 05:03:53 [Server] INFO [SavageDeathChest] SQLite datastore initialized. 20.03 05:03:53 [Server] INFO [SavageDeathChest] Multiverse-Core detected. 20.03 05:03:53 [Server] INFO [SavageDeathChest] Enabling SavageDeathChest v1.6.2 20.03 05:03:51 [Server] INFO [SavageDeathChest] SQLite datastore connection closed. 20.03 05:03:51 [Server] INFO [SavageDeathChest] Disabling SavageDeathChest v1.6.2 20.03 05:03:51 [Server] INFO KaizenWorlds issued server command: /plugman reload SavageDeathChest
Then I killed myself which looked like this in console: 20.03 05:05:07 [Server] INFO KaizenWorlds issued server command: /back 20.03 05:05:01 [Server] INFO KaizenWorlds died 20.03 05:05:01 [Server] INFO KaizenWorlds issued server command: /strike KaizenWorlds 20.03 05:05:00 [Server] INFO KaizenWorlds issued server command: /strike KaizenWorlds 20.03 05:04:59 [Server] INFO KaizenWorlds issued server command: /strike KaizenWorlds
No death chest, no error.
If I run the /sdc command I get this: [SavageDeathChest] Version: 1.6.2 Language: en-US Storage Type: SQLite Chest Expiration: 60 minutes Protection Plugin Support: Factions: [check-on-place] GriefPrevention: [check-on-place] Enabled Worlds: [world, world_nether, world_the_end, G2Games, mugs]
Back to you.
@puckman1971
Make sure you've got the latest version (1.6.2) for 1.9 servers. Make a backup of your entire config folder by renaming it, so the plugin can generate all new files. Check your log for errors or other information, and let me know if it is still not working and any errors in the log.
I just loaded 1.9 and deathchest loaded fine but does not seem to work. No chests are being generated. I trashed the config file so the plugin could create a new one but no joy
@Androkai
- essentials.fly.safelogin
:)
@Androkai
That's troublesome. I'm not sure if there is anything I can do within my plugin to prevent it, but if I think of something I'll put it in. My plugin listens for the PlayerDeathEvent, which is an event that can't be cancelled, so it's seems likely another plugin is actually restoring the player state after a fall death happens immediately after login. Your best bet would be to see if you can track down the plugin that is causing the behavior, and see if there is an option to turn it off, and if not, request the developer to make it optional.
I know essentials has a safe login feature, but as I recall that just puts a falling player into fly mode on login. It requires a player to have a specific permission node to enable it.
If a player logs off while falling and rejoin he falls down, a death message and the chest appears but any of my plugins (maybe Essentials/WorldGuard) or Spigot itself saves the player from death so he revives (not really, nothing happens, he only isn't death). The problem is, that he can duplicate his inventory with this. I'm not sure if it's possible for you to do something against this (maybe there is a death.cancel event or something like that you can access).
@der_Kernschatten
Ok, that definitely clarifies the issue for me, thanks a bunch for that. I think the best I can do in the near future is to add a message that a chest couldn't be placed in the void, instead of the success message, as I mentioned before. My biggest concern is that the valid location search is already getting fairly heavy, so I'm afraid of causing lag when a player dies.
Ultimately, the chest deployment should be made asynchronous, so that it runs in a separate thread from the main server, but this would be a fairly massive undertaking. It would require taking a snapshot of all the blocks within the search distance of the player at the time of their death, and some sort of queue would be necessary so when players die at the same time with an overlapping search area (think creeper explosion), the placed chests don't end up overlapping. Each chest deployment would have to take place one at a time so subsequent deployments would take the previous chests into account in their search area snapshot. It makes my brain hurt just thinking about it, which I have quite a bit.
@erdrickk
As far as putting limits on what quantity of items get placed in the chest, or what a player's killer can take, which is a feature that has been requested a few times before, I'm afraid there's some technical reasons this can't be easily implemented in the plugin as it stands now. The way I designed the storage just simply didn't take such features into account at the time. Basically, each component of a death chest (left chest, right chest, sign) are handled as distinct individual objects. Again, I never intended such features when I initially designed the plugin, and this was an elegant solution that made many aspects of the plugin simpler.
I do intend to make a version 2.0 at some point in the future, with improvements to the location search and placement, (possibly even the asynchronous operation mentioned above), and also to use a grouping of the individual chest pieces in the datastore so that chests can be referenced as a single object, at which point it should be possible to keep track of how many items have been removed from a chest by the killer, or similar features. Although, I can see how things could get complicated with regard to deciding what items to keep or what have you. I imagine some will ask for it to take item value into consideration for instance, or only allow this or that type of item to be taken, etc.
@timsavage
Pardon, my initial question/report was very lacking in detail so it may have caused some confusion.
I used /back (essentials command that costs $) and it brought me to a chest floating without a block within a radius of 20.
Yes, it would be nice if it was possible for a chest to occur where they fell off, however, I do recognize that this could be an issue. It's one thing to search for a placeable area within a radius of 4 blocks. It's exponentially rediculous to start searchin in a radius of 20+ just for a skyisland. Looking directly above, and only directly above (maybe even with a radius of 1) could possibly be an option because while one might think there might be nothing there, there generally is some form of lateral momentum in the fall. All in all, sounds like more hassle than it's worth to code unless there is a lot of interest.
Part of the intent with a skyisland is the challenge, sure, but a lot of our players are living in a rural area with mixed internet or old computers, so maybe a third of the time the death isn't quite their fault.
For the time being, I will happily shut off the void capability and tell folks "sucks to be you." :p
My intent (and desire) with this plugin is to allow for challenge to still exist in the game, but for some deaths to be a little forgiven give that a third aren't necessarily the player's doing. This plugin is almost too forgiving, much like you allude to in your paragraph talking about the sky island, but it's the best I've found for 1.9.
What I've done with it now, is to force a player to carry a chest (you forgot? too bad, no benefit for you), limit the time the chest exists to 5 minutes (not enough time if you went too far from your bed/home), and zero chest protection. I think it would be kind of neat for them to lose parts of stacks (the fun-hard-mode/Extra Hard Mode plugin does this on death) or be monatarily charged per use. I'm unsure of how to best implement though. I want challenge, but I do like the benefit of this plugin.
@erdrickk
I would also 'vote' for such a suggestion for reasons discussed above.
I'd like to make a suggestion - is it possible when killed by another player to drop a chest with a defined percentage of items in the chest? so say player A kills player B, player B drops a chest with only 25% of his items, the rest are still in his possession. The logic behind this is if someone gets jumped, they don't lose everything they have on them and I'm able to leave chests unlocked so the killer is able to get SOME reward. I figure it balances it all out.
@der_Kernschatten
I recently added a requested feature that places the chest above the void when a player dies in the void, because blocks cannot be placed in the void even by plugins, so the chest would not be created at their death location (in the void) and they would lose their inventory.
Are you using a plugin that changes the players respawn location after death? Normally they would respawn either at the world spawn, or their home (bed) spawn location. It sounds like something on your server is altering this behavior to respawn players atop the first 'safe' place above the void at the same x,z coordinates where they died, which in this case will be on top of the newly placed death chest at y level 1. (I guess I can see where this would be what you want with sky islands, so the player respawns on the island they fell off, rather than a world spawn or bed spawn location.)
So I'm not really sure what would be the best solution to this issue. Perhaps an option that places the chest above the first solid block at the players x,z coordinates when they fall into the void? But since they fell off, it seems likely there isn't going to be a solid block directly above their death location, and searching for a 'nearby' solid block might be difficult, as it would have to check all the surrounding locations at each level above the void until it 'hits' something.
Also, isn't part of the point of sky islands the fact that you're going to lose all your inventory if you fall off? Placing a death chest at the place they fell (and are going to respawn) seems to remove the intended challenge, and frankly, you might as well just set the server to keep player inventory on death. Am i wrong?
Edit: If you'd simply like to revert to the previous behavior of not placing a chest at all when they fall into the void, there is a new config setting for disabling the new feature. If you upgraded without having the plugin regenerate a new config, you can add this option manually by putting the following line anywhere in your config.yml:
place-above-void: false
In a future release, I will add a message that says your chest could not be placed in the void, rather than the successfully placed chest message that gets displayed now when that happens.
When I fall from a skyisland into the void, I found myself spawning top of a chest just above the void with nowhere to go. Is this a bug or is the island too high to detect that it could put a chest there (there were blocks above)?