MLG-Fortress / ExtraHardMode

The now-official repository for the ExtraHardMode Bukkit Plugin.
http://dev.bukkit.org/bukkit-plugins/fun-hard-mode/
Other
24 stars 19 forks source link

Items Mobs Pick Up NOT Dropping on Death #304

Open Wuffeh opened 2 years ago

Wuffeh commented 2 years ago

Items are disappearing when picked up by mobs, such as zombies, when dropped in front of them by players.

When this setting is set to 'false' the issue is resolved:

  General Monster Rules:
    Inhibit Monster Grinders: true

This issue happens when the mobs are spawning normally, such as on grass and are killed with a bow. No item is dropped, when the mob picked up an item dropped by a player who was killed or who dropped the item normally.

It's still worth it to leave it on. It's one of the main reasons I use the plugin. But, this bug is a seriously bad issue; players can lose their netherite sword merely because a zombie picked it up for half a second. Please fix this! Thanks!

Chozo4 commented 2 years ago

I've noticed this issue as well. This was confirmed by using another plugin (Buscript - plugin to use scripts via javascript instead) to set for example "setItemInMainHandDropChance(1.0) after having picked up an iron sword and then testing for drop after being killed.

My solution for this and the same issue on zombie resurrection was to hook EntityPickupItemEvent and EntityDeathEvent. Then after track the entity ID and items picked up and force them as a drop after death. A more simple solution would be to instead disable zombie item pickup altogether by hooking EntitySpawnEvent and disable zombies being able to pickup items via "setCanPickupItems(false)"

I don't know JAVA so cannot fix this in EHM itself but thought adding my thoughts on a remedy would be helpful.