Looting affects inventory drops from Spirits
Wxrlds opened this issue ยท 3 comments
Describe the bug
When a spirit is killed with extremely high looting levels it's inventory drops more items than it had
To Reproduce
Steps to reproduce the behavior:
- Give yourself a sword with high looting
/give @s netherite_sword{Enchantments:[{id:"minecraft:looting",lvl:64s}]} 1
- Summon the otherworld sapling trader
- Throw trader one unstable otherworld sapling
- Kill trader with looting sword 1. (Make sure the sapling is still in it's inventory/hand)
- Profit
Expected behavior
The Spirit should only drop the one sapling you gave it
System (please complete the following information):
- Occultism Version: occultism-1.16.5-1.0.15
- OS: Windows 10
- Minecraft Version: 1.16.5
- Forge 36.0.46
- curios-forge-1.16.5-4.0.5.0
- Patchouli-1.16.4-50
- jei-1.16.4-7.6.1.71
Additional context
From my testing this also works with any other item if you place it into the spirit's inventory, not only Saplings.
This is probably not really something you can achieve in normal survival mode but considering that some mods remove enchantment level caps it could be easily exploitable.
@Wxrlds that's an interesting one, as vanilla I let vanilla handle the drops I was not aware that could even happen. Do vanilla mobs with inventories do the same or do they handle it correctly? (e.g. donkey with chest saddle).
From my testing with looting 64 and looting 127 this doesn't happen on a donkey with a saddle and the chest with items inside.
@Wxrlds thanks for testing! Turns out minecraft is a bit cheeky and actually applys loot logic even to in-code drops, I updated the code to match the donkey exactly and it no longer duplicates.