Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Igniting sulfur cube throws EntityUnleashEvent even if not leashed

Open agusmeroli opened this issue 5 months ago • 0 comments

Expected behavior

The EntityUnleashEvent should only be called if the sulfur cube was actually leashed, like for other mobs on their death.

Observed/Actual behavior

The EntityUnleashEvent is triggered every single time any TNT sulfur cube explodes, regardless of leash status.

Some plugins assume that if an EntityUnleashEvent is triggered before the leash breaks, the entity is leashed, but since this now no longer the case, IllegalStateException can get thrown when getting the leash holder.

It should be fairly simple to add an isLeashed() check before throwing the event.

Steps/models to reproduce

  • Create a plugin that listens to EntityUnleashEvent.
  • Spawn a sulfur cube
  • Give it TNT
  • Ignite it and wait
  • Event will be triggered even tho the entity is not leashed

Plugin and Datapack List

Testing plugin

Paper version

Paper version: 26.2-48-main@87c4d42

Other

No response

agusmeroli avatar Jul 05 '26 16:07 agusmeroli