[SPIGOT-3999] HangingEntities broken by Boats do not fire HangingBreakByEntityEvent, only HangingBreakEvent. Created: 14/Jul/18  Updated: 21/Oct/19

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

Type: Bug Priority: Minor
Reporter: Llm Dl Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: HangingBreakByEntityEvent,, HangingBreakEvent,

Version: This server is running CraftBukkit version git-Spigot-642f6d2-ab13683 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)

 Description   

I'm trying to protect hanging entities like itemframes from Boats ridden by players but currently boats only fire a HangingBreakEvent, with RemoveCause.PHYSICS. 

Because the HangingBreakEvent can only get the entity broken and not the cause like HangingBreakByEntityEntity, to protect itemframes from boats you must cancel all PHYSICS caused breaks. Doing this means itemframes and the like do not get removed when the block they're attached to is destroyed.

A HangingBreakByEntityEvent should be fired and the RemoveCause should probably also be changed to ENTITY from PHYSICS.



 Comments   
Comment by Ignacio Pozo [ 21/Oct/19 ]

This is still present in the final 1.13.2 Spigot version and git-Spigot-56f8471-7554e08 (MC: 1.14.4)

Comment by Llm Dl [ 16/Jul/18 ]

I will investigate it some more for sure. This is something very serious for protection plugins.

Comment by md_5 [ 16/Jul/18 ]

I'm talking about from a code perspective.
It's not "boat hit painting", or even "entity hit painting"

It is "a bounding box exists in the vicinity of the painting".

If you believe my assessment is wrong and there is a trivial fix, you are welcome to contribute it:

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse

Comment by Llm Dl [ 16/Jul/18 ]

What leads you to believe that it is not specifically the boat? No item frames will break if it's not a boat. ( I will test if it's also happening when a minecart is used next.) Either way it depends on an ridden entity smashing the item frame like it's a lily pad.

Comment by md_5 [ 16/Jul/18 ]

Right, so the thing is its not specifically a boat here.
It's "some bounding box exists in the same as the hanging".

I don't see this being fixed, it'd be fairly significant code changes to rewrite the methods to pass up the entity with the intersecting bounding box.

Comment by Llm Dl [ 15/Jul/18 ]

On land, place a boat and ride it into a wall which has the bottom layer covered in item frames. It can take a bit of 'grinding' against the wall to get them to break but they do break. I did not test using paintings.

Comment by md_5 [ 15/Jul/18 ]

Do you have more info on how to do this?
I rammed my boat into a painting and nothing happened.

Generated at Tue Apr 01 10:18:44 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.