UseItemStackEvent.Start And LaunchProjectileEvent Troubleshooting [6.0.0]

Sponge Build: spongeforge-1.11.2-2226-6.0.0-BETA-2112
Forge Build: forge-1.11.2-13.20.0.2226-universal
Java Version:1.8.0_121-b13

Hello, so I have two simple listeners that I wish to further develop, but I can not get them to function in their basic form. I don’t know if I’m either dumb and not using the correct listeners, or if I’ve encountered some sort of bug. Any help would be appreciated. :slight_smile:

//prevents users form using potions in the lobby
@Listener
public void onPlayerConsumption(UseItemStackEvent.Start event,@First Player player){

    	event.setCancelled(true);
}

//prevents players from throwing potions at each other in the lobby
@Listener
public void onPotionThrow(LaunchProjectileEvent event) {
	
        event.setCancelled(true);
}

Can we see more code? There are two possibilities in your sitiuation:

  1. The events aren’t fullly implemented, which I find unlikely (though LaunchProjectileEvent may not be)
  2. You aren’t properly registering the listeners, so, where are these listeners? Are they in your plugin class or in some other class? If they’re in a seperate class, do you register them in the plugin class?

Although my comments above the listeners suggest that there is more to code, this is literally all the code there is for the listeners themselves, at the moment. These minor listeners are in a registered ArenaListeners class that contains other functional listeners. The listeners class is registered in my main class as game.getEventManager().registerListeners(this, new ArenaListeners());

I am trying to use LaunchProjectileEvent for my plugin, where i want to listen to players shooting a bow, and it seems like the event is just never posted.

Yep, still waiting to see if anyone has gotten it to work.:disappointed:

I’m sorry I can’t be of much more help, but I recommend you create a new bare-bones plugin project with just enough code to check if you can get the event to work. If it still doesn’t work, I suggest you submit an issue on the Spigot API repo:

I’ve done both. but my report was never addressed.

Unless your issue is closed, it will get addressed at some point. Sometimes issues fall further down the pile as more critical ones pop up.

2 Likes

I found another event that is never fired, ChangeBlockEvent.Grow