Blast causing buried treasure to duplicate
NightScythe1 opened this issue · 9 comments
When players on my server use the 'blast' spell on an unopened buried treasure chest, (usually accidental while using the spell to dig for it) the items fall to the ground as though the chest was broken normally. Then once blast regenerates the terrain the chest regenerates its inventory, meaning players get 2 of each item.
Magic version is the latest build and I'm on the latest Spigot 1.14.4
Is this something specific to buried treasure? Have you tried it with regular chests?
So far these sorts of reports always turn out to be due to some other plugin interfering. Most recently it was FurnitureLib, for instance.
So far the exploit only happened with buried treasure chests, and is not able to be replicated with player placed chests. Once I’m able to tomorrow I will test with other generated chests like in villages and temples as I think that could be the cause, but the only plugin I could imagine interfering is “openinv” if that’s even possible. The player who discovered the bug said that it only works if you don’t blast the chest directly, you are on the same level as it or above, and that the chest vanished and drops the items rather then being thrown/falling down like other blocks behave like when blasted. I can provide a plugin list if needed
Thanks, I'll try to test this out when I get some time.
I don't think there is anything special about sunken treasure chests. Behavior should be the same if you just place a chest with some items in it. Perhaps the main difference would be that it's probably rare to find a populated chest in an unprotected area, assuming you have some player protection plugins.
Next release will clear the loot table from these blocks just to be safe. Still leaving containers as indestructible for now.
So I found some buried treasure and I can confirm the bug.
In the latest plugin versions I have made all containers indestructible to magic, which should fix the problem.
But I am curious why there's a specific issue with buried chests. Might be something to do with it being waterlogged, I guess. I'm going to keep this open until I figure it out.
Well, fun fact!
These chests are special. They do not contain items, but are hooked up to a loot table, when destroyed they drop loot much like a mob.
This means the plugin clearing the chests' inventory prior to destroying the block will not remove the drops.
I'm going to see if there's a better solution, it's always seemed crazy to me that containers drop items when programmatically setting them to air.
@killme you wouldn't happen to know of a better way to clear a chest so that it won't drop its contents, would you?
One more note before I wrap this up for now, it seems like Spigot may consider this behavior as a bug: