You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
SpongeVanilla version: 7.2.1, also tested with 7.1.8
Java version: 1.8
Operating System: Windows 10
Plugins: My testing plugin exclusively
Issue Description
This is a bug that can be consistently reproduced. The nature of the issue is simple: InteractItemEvent.Primary is not fired in some specific cases, though it should be.
From what I've understood from this, this event should be fired when a player left clicks with an item, without aiming at a block (meaning, aiming either at the air or at an entity). In case I'm targetting a block, then InteractBlockEvent.Primary will be fired instead. The item is of course held in my main hand. And to prevent InteractBlockEvent.Primary from being fired along with InteractItemEvent.Primary, I used the following code:
if(event.getTargetBlock().getState().getType() == BlockTypes.AIR) {
// Meaning that InteractItemEvent.Primary is already being firedreturn;
}
So far so good. In most cases, the InteractItemEvent.Primary event works perfectly fine. However, there is an issue in a very specific case: when I'm interacting with an item and almost targetting a block, but still too far for actually reaching it (proof that I'm too far is: the black lines indicating which block I'm targetting don't appear). In this case, neither InteractItemEvent not InteractBlockEvent are fired. Here is a gif showing an example: particles are fired when the event is called. As you can see, I start by clicking on the grass, firing the InteractBlock.Primary event. Then, I aim at the sky, firing the InteractItemEvent.Primary. But eventually, when I aim at those grass blocks while being too far to reach them, nothing is fired.
I don't believe there is any need for including code samples, let me know if you disagree, I'll post my code.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am currently running
Issue Description
This is a bug that can be consistently reproduced. The nature of the issue is simple:
InteractItemEvent.Primary
is not fired in some specific cases, though it should be.From what I've understood from this, this event should be fired when a player left clicks with an item, without aiming at a block (meaning, aiming either at the air or at an entity). In case I'm targetting a block, then
InteractBlockEvent.Primary
will be fired instead. The item is of course held in my main hand. And to preventInteractBlockEvent.Primary
from being fired along withInteractItemEvent.Primary
, I used the following code:So far so good. In most cases, the
InteractItemEvent.Primary
event works perfectly fine. However, there is an issue in a very specific case: when I'm interacting with an item and almost targetting a block, but still too far for actually reaching it (proof that I'm too far is: the black lines indicating which block I'm targetting don't appear). In this case, neither InteractItemEvent not InteractBlockEvent are fired. Here is a gif showing an example: particles are fired when the event is called. As you can see, I start by clicking on the grass, firing theInteractBlock.Primary
event. Then, I aim at the sky, firing theInteractItemEvent.Primary
. But eventually, when I aim at those grass blocks while being too far to reach them, nothing is fired.I don't believe there is any need for including code samples, let me know if you disagree, I'll post my code.
The text was updated successfully, but these errors were encountered: