apavarino / Deadchest

Minecraft Plugin - Keep your inventory in a chest when you die !
https://dev.bukkit.org/projects/dead-chest
GNU General Public License v3.0
18 stars 17 forks source link

Let DeadChests look for "safe" solid blocks when player dies in lava (or water) #47

Open LaurenceBarnes opened 2 years ago

LaurenceBarnes commented 2 years ago

Is your feature request related to a problem? Please describe. Normally, it is quite annoying that DeadChests spawn right where the player died, specifically when it is inside of lava.

Some servers that use DeadChest, might for example do so because they wish players to not lose inventories when dying in lava. As of now, the DeadChest will spawn right in the lava. While that surely still is recoverable, there is a legitimate reason to wish for an alternative solution for this.

Describe the solution you'd like The solution: A config option that allows to use a search radius when players die in lava (and possibly, for water and air deaths too, but separately in this case). It would look for the nearest solid block that has any kind of air (cave air, normal air, and whatever there is) on top of it.

For water and air I'd suggest to slightly change the approach. In either case it would be fine if it spawns just on the nearest solid block, does not matter whether it is covered with water or air.

Such kind of function might however use up some performance, although just happening rather rarely (depending on server size). If that is an issue that cannot be solved by using efficient methods, a limit as to how far it looks for spawning a DeadChest could be implemented.

Describe alternatives you've considered Well just dealing with it 😎 :(

Additional context