EssentialsX

EssentialsX

2M Downloads

Powertool triggers on right click air with throwables

GriffinCodes opened this issue ยท 2 comments

commented

Information

Full output of /ess version:
image

Details

Description
Powertools trigger on right click with throwables and honey bottles (maybe more, idk). This is caused by https://hub.spigotmc.org/jira/browse/SPIGOT-5435 - in short, playerinteractevent is wrong.

	public void onPlayerInteract(final PlayerInteractEvent event) {
		BNCore.log("interact event: action: " + event.getAction() + " / hand: " + event.getHand());
	}

Throwing one snowball (one right click of mouse):

[18:42:33] [Server thread/INFO]: [BNCore] interact event: action: RIGHT_CLICK_AIR / hand: HAND
[18:42:33] [Server thread/INFO]: [BNCore] interact event: action: LEFT_CLICK_AIR / hand: HAND

Since this is an upstream bug that's marked as invalid, any fix would have to be a workaround at the plugin level. Not expecting a fix, but figured it was worth mentioning.

Steps to reproduce

  • Assign a powertool to a snowball/potion/expbottle/any throwable (or honeybottle)
  • Throw the projectile with right click
  • Powertool is activated

Expected behavior

  • Powertool doesnt activate (left click only)
commented

Not sure if this is important enough to fix in Essentials, because I wouldn't expect many people to be trying to user power tools with projectiles. Definitely weird though that upstream throws a left click event for what is actually a right click.

commented

Essentials already filters the event to left click, and there isn't otherwise any way to distinguish between them, other than some nasty hackery.