[SPIGOT-7830] WindCharge does not fire EntityInteractEvent Created: 14/Jul/24  Updated: 25/Dec/24  Resolved: 16/Jul/24

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

Type: Bug Priority: Minor
Reporter: tastybento Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None

Attachments: File TestPlugin-1.11.2-SNAPSHOT-LOCAL.jar    
Version: This server is running CraftBukkit version 4263-Spigot-491f367-bed1e3f (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

WindCharge is an Entity and a Projectile (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/WindCharge.html) so I would assume that when it is aimed at buttons, or pressure plates, etc, and triggers them, that it would result in the firing of the EntityInteractEvent, however it does not.

Here's the test code:

public class TestPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getLogger().info("Test plugin loaded");
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = false)
    public void onProjectileHit(EntityInteractEvent e) {
        Bukkit.getLogger().info(e.getEventName());
        if (e.getEntity() instanceof Projectile p) {
            Bukkit.getLogger().info("The projectile was a " + p.getShooter());
        }
    }
} 

Set up a button on a tree for example, step away and fire a wind charge at the button, it will activate, but no event will fire. Fire an arrow with a bow at the same button, and you'll see the logging in the console.

I assume that this event is the one that fires, but if there's another then I apologize.



 Comments   
Comment by Llm Dl [ 02/Nov/24 ]

tastybento did you figure out how to block the button/trapdoor/door toggling when the wind burst comes from a mace smash attack (where the mace has the wind burst enchant)?

Comment by tastybento [ 14/Jul/24 ]

Actually, I see that EntityExplodeEvent is the one to use. Sorry, this can be closed.

Generated at Wed Apr 02 10:57:20 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.