WorldGuardExtraFlags icon indicating copy to clipboard operation
WorldGuardExtraFlags copied to clipboard

[Bug] Keep-inventory not dropping items on death if gamerule keep inventory true is set

Open rm20killer opened this issue 2 years ago • 3 comments

Steps to reproduce:

  1. Install WorldGuard & WorldGuardExtraFlags
  2. Create a region with "Keep-inventory" flags set to false and /gamerule keepInventory true
  3. kill player inside the region

Expected result: Player drops items on the ground when killed.

Actual results: Player inventory is cleared and items are not dropped.

rm20killer avatar Nov 04 '22 23:11 rm20killer

This is a tricky area because the list of items that are going to be dropped is empty due to the world having keep inventory on. But it's somewhat straight forward to fix as you can set the drop content to be the whole inventory minus items with vanishing enchantment but this would need to be manually specified and is a bit fragile in my opinion. Also due to the way plugins could alter the drop list based on its content is somewhat worrying to me as this could lead to several incompatibilities with other plugins. But I guess that should not be as big worry as those should have specified higher priority than normal.

I was actually aware of this issue and decided to not implement any fixes for it due to the problematic edge cases and just take another look at it if someone complained about it.

As a workaround, you can remove the keep inventory game rule and set it to the global region. This way everything actually just works.

aromaa avatar Nov 26 '22 00:11 aromaa

This workaround doesn't seem to work anymore. I have the gamerule set to false, keepInventory set to allow on the global region and set to deny for my subregion, I lose my items on death but they don't drop. Outside of the subregion I keep them as intended.

BoudewijnPopkema avatar Mar 10 '24 22:03 BoudewijnPopkema

Plugins are known to conflict with the the keep inventory flag itself. Most likely the case here too.

aromaa avatar Mar 10 '24 22:03 aromaa