oddlama / vane

Immersive and lore friendly enhancements for vanilla Minecraft
MIT License
276 stars 34 forks source link

Add a tombstone system #41

Closed vale075 closed 2 years ago

vale075 commented 3 years ago

Hello, would it be possible to add a tombstone system? When someone dies all its items are collected in a chest. The reason I ask here is that it would need to be compatible with world_rebuild in case you die of a creeper explosion and also with the Soulbound enchant. It could have dynmap integration.

I think it would be a great addition to this already absolutely amazing plugin!

oddlama commented 3 years ago

Thanks for the suggestion! I'll have to think about how this would be doable while maintaining a vanilla feeling. I can see that this is (near) impossible to be implemented correctly by another plugin. You are absolutely right that world rebuilding and soulbound could be issues if this was implemented by another plugin.

For world rebuilding, currently a chest placed on a block that will be rebuilt later will cause the chest to be naturally destroyed later (i.e. dropped with contents), which would be bad in case of tombstones. The only solution I can see is to never place the chest where a block will be rebuilt. (Hint to self: explosion and death event order may be critical here)

I also see some other corner cases. Feel free to comment on them if you've got any ideas or suggestions:

  1. A player falls in the void
  2. A player dies mid-air (but with ground somewhere below)
  3. A player dies on top of the highest possible block and there is no space to put the chest
  4. A player dies on a tombstone
  5. A player dies inside a block made of something (cobweb, water (could replace), snow, sign)
  6. A player dies in a protected region (spawn, vane-regions)

Dynmap integration would certainly be possible although I could also imagine this cluttering the map a little too much if players don't remove their tombstones. Also I can see scenarios where tracking existing tombstones could become problematic (not impossible, just not trivial to implement).

(Note to self again: Optionally tombstones could be protected such that only their owner may retrieve them.) I'll have a look at this again when I have time to implement it.

vale075 commented 3 years ago

PS: I wrote an essay, sorry XD

Wow! First of all, thank you very much for your detailed response!

Vanilla feel

For the vanilla feel, you are right. This would be more of a quality of life improvement, like disabling creeper griefing has it can be very frustrating for a player to die and lose everything. The chance of losing everything if you die can make the game more thrilling but I feel it can generate a lot of frustration and be the reason you quit the game, after losing a lot of stuff accidentally.

To try and keep a more vanilla feeling we could try to find a consequence to getting back your stuff:

The mechanic itself

I don't know if you can do custom blocks with plugins, but it could be a sort of slab buried one block in the floor. For placing, you would look up the player's death position and replace the first solid block that appears underneath him (counting lava has a block, for water you could make it "float" or sink down to seafloor) except if it is bedrock in what case you place it on top of the bedrock. After being cleared out or if left out for too long (see idea on tombstone slowly decaying) the tombstone would simply be destroyed and the block it replaced would get brought back exactly like for the explosion rebuilding already present in the plugin.

For the cases you talked about:

Dynmap/Tombstone retrieval

For the Dynmap integration I was thinking of the server I have with my friends where everybody is friendly, so in that scenario it wouldn't be a big deal. But it should definitely be optional (if it even exists in the first place) for bigger servers where griefing is allowed. This asks the question of how you would find a tombstone if you didn't use Dynmap. In that case you could maybe use a special compass that indicates the direction and appears in the inventory of the person who died that could be passed to other people and disappear with the tombstone. Then a cool mechanic would be to be able to craft a tombstone finder that indicates the position of the nearest tombstone for big servers and people would be some sorts of grave diggers. But now I'm going a bit far XD

All of the above are ideas, do whatever you feel fits best the plugin if you even feel like implementing something. The plugin is absolutely great and I love the vanilla feeling it keeps. Thank you!

oddlama commented 2 years ago

Hi! After careful consideration I decided that this is unfortunately too far out-of-scope for vane. I can't help it but feel like it's adding too much on top of vanilla and would be better suited for a separate plugin. But I like the idea very much and think it might be a cool option to have. There is nothing that requires vane to implement this feature, and a gravestone plugin could easily add support for vane without vane doing anything. As there already exist a plethora of gravestone plugins, I'd much rather see support for vane added in one of these popular plugins.

Compatibility with vane would be easily achieved: The tombstone can be excluded from the block destroy event before vane processes it (other plugin has to use lower priority on the explosion event, I know, sounds wrong but is right), if it even is a part of it. It just needs to make sure that it isn't inside a block that was exploded, so that vane doesn't override it. Soulbound items can be excluded by examining the enchantments NBT and looking for vane_enchantments:soulbound. I'd be willing to implement an API for this if necessary.

I might open an issue on one of these plugins and link to this issue. With a bit of luck they also like vane and are willing to implement support for vane. (If anyone is coming from a gravestone plugin, I'm available to help with implementing compatibility over on discord, just ping me)

oddlama commented 2 years ago

I've opened an issue in a very popular plugin called Graves regarding this. Lets see what they say :)

ryantheleach commented 2 years ago

I'm currently using Graves on my server, will let you know if I run into trouble, as I planned on using soulbound or something like it, on my start item kits :-)

oddlama commented 2 years ago

Cool cool, I remember that I did test it once when I talked to the people from Graves, but couldn't identify any issues. Just let me know if anything unexpected comes up.