[SPIGOT-6669] Shearing a Mooshroom does not fire EntityDropItemEvent Created: 23/Jul/21  Updated: 23/Jul/21  Resolved: 23/Jul/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Esophose Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.17.1, EntityDropItemEvent, mooshroom, shearing
Environment:

Windows 10 (21H1 - OS Build 19043.1083)

AdoptOpenJDK-16.0.1+9


Version:  CraftBukkit version 3198-Spigot-18c71bf-0abf420 (MC: 1.17.1)
Guidelines Read: Yes

 Description   

Mooshrooms do not fire the EntityDropItemEvent when sheared and turned into cows even though they always drop 5 mushrooms. 

To reproduce:

  • Create and run a plugin that listens to the EntityDropItemEvent and prints out the entity type and item type dropped. Example code can be found at the bottom of this issue.
  • Spawn a Mooshroom using a spawn egg.
  • Grab some shears and right click on the Mooshroom.
  • 5 mushrooms will drop and no events will be fired.

Time to reproduce: Less than a minute.

Expected result: The EntityDropItemEvent is fired 5 times, once for each item dropped. This would match the behavior when shearing sheep (firing the event between 1 and 3 times depending on the wool amount dropped). It would probably make most sense for the entity in the event to be the Mooshroom rather than the newly spawned cow, but either would work. 

 

Example code to view issue:

@EventHandler
public void onEntityDropItem(EntityDropItemEvent event) {
    Bukkit.broadcastMessage(event.getEntityType() + " dropped " + event.getItemDrop().getItemStack().getType());
}

Generated at Tue Apr 22 04:20:18 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.