Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct control is triggered if dropping the pilot tool is cancelled #660

Open
Nikkilectric opened this issue Jun 24, 2024 · 6 comments
Open
Labels
bug Issues causing negative effects for end users

Comments

@Nikkilectric
Copy link

Describe the bug
Direct control is triggered if pilot tool drop event is cancelled

To Reproduce
Steps to reproduce the behavior:

  1. Cancel the drop event for the pilot tool (In my case, via Skript, which then triggers /rotate left afterwards)
    Expected behavior
    It should not enter direct control.

Screenshots
See attached video for this issue.

Versions (please complete the following information):

  • Movecraft: v9557e6f999464f0f842e7624e8f862b3d1bd947 (Dev build)
  • Addons: None
  • Java JDK 21 (unsure which dist)
  • Minecraft 1.21

Additional context

2024-06-23.23-03-28.mp4
@Nikkilectric Nikkilectric added the bug Issues causing negative effects for end users label Jun 24, 2024
@Nikkilectric
Copy link
Author

Appears as if this is a spigot/paper bug, unrelated to movecraft. Closing the issue.

@Nikkilectric
Copy link
Author

This can be solved with PlayerDropItemEvent, Here's another video of the issue:

2024-09-05.17-55-23.mp4

As you can see, it does not trigger when looking at a block, but triggers when dropping the item facing air

@Nikkilectric Nikkilectric reopened this Sep 5, 2024
@TylerS1066 TylerS1066 moved this from New to Waiting for Replication in Issue Triage Sep 6, 2024
@Intybyte
Copy link
Contributor

This can be solved with PlayerDropItemEvent, Here's another video of the issue:
2024-09-05.17-55-23.mp4

As you can see, it does not trigger when looking at a block, but triggers when dropping the item facing air

This cannot be fixed in any vanilla server software, no matter if you are running paper, bukkit, let me explain why,
What happens is that internally there are 2 packets, lets call it packet A and B
Packet A is sent when dropping an item
Packet B is sent to play the "hit" animation

When dropping an item A and B are sent
When hitting something in general B is sent only

So the only way to check if the client player is hitting something is check packet B, which also is used when dropping item, and oacket B doesn't have information about the cause of the "hit" animation. Hence this is not fixable by us, by paper, by spigot, by bukkit. Maybe with a modded client implementing your own event & packet, but it is more pain than it is worth

@Altylectric
Copy link

This can be solved with PlayerDropItemEvent, Here's another video of the issue:
2024-09-05.17-55-23.mp4
As you can see, it does not trigger when looking at a block, but triggers when dropping the item facing air

This cannot be fixed in any vanilla server software, no matter if you are running paper, bukkit, let me explain why, What happens is that internally there are 2 packets, lets call it packet A and B Packet A is sent when dropping an item Packet B is sent to play the "hit" animation

When dropping an item A and B are sent When hitting something in general B is sent only

So the only way to check if the client player is hitting something is check packet B, which also is used when dropping item, and oacket B doesn't have information about the cause of the "hit" animation. Hence this is not fixable by us, by paper, by spigot, by bukkit. Maybe with a modded client implementing your own event & packet, but it is more pain than it is worth

Interestingly enough, the "hit"/PlayerInteractEvent (Packet B) packet does NOT trigger if the player is looking at a block and dropping! a fix can be implemented using packets or placing an invisible block in front of the player (if facing air), I have this in my own plugin, but I figured it may be useful to have in the main plugin hence the request!~

@Intybyte
Copy link
Contributor

This can be solved with PlayerDropItemEvent, Here's another video of the issue:
2024-09-05.17-55-23.mp4
As you can see, it does not trigger when looking at a block, but triggers when dropping the item facing air

This cannot be fixed in any vanilla server software, no matter if you are running paper, bukkit, let me explain why, What happens is that internally there are 2 packets, lets call it packet A and B Packet A is sent when dropping an item Packet B is sent to play the "hit" animation
When dropping an item A and B are sent When hitting something in general B is sent only
So the only way to check if the client player is hitting something is check packet B, which also is used when dropping item, and oacket B doesn't have information about the cause of the "hit" animation. Hence this is not fixable by us, by paper, by spigot, by bukkit. Maybe with a modded client implementing your own event & packet, but it is more pain than it is worth

Interestingly enough, the "hit"/PlayerInteractEvent (Packet B) packet does NOT trigger if the player is looking at a block and dropping! a fix can be implemented using packets or placing an invisible block in front of the player (if facing air), I have this in my own plugin, but I figured it may be useful to have in the main plugin hence the request!~

hahahah gaslighting the client that sounds cool, why don't you PR the fix then? or is it another plugin that fixes said issue in such a way?

@Altylectric
Copy link

Altylectric commented Feb 20, 2025

This can be solved with PlayerDropItemEvent, Here's another video of the issue:
2024-09-05.17-55-23.mp4
As you can see, it does not trigger when looking at a block, but triggers when dropping the item facing air

This cannot be fixed in any vanilla server software, no matter if you are running paper, bukkit, let me explain why, What happens is that internally there are 2 packets, lets call it packet A and B Packet A is sent when dropping an item Packet B is sent to play the "hit" animation
When dropping an item A and B are sent When hitting something in general B is sent only
So the only way to check if the client player is hitting something is check packet B, which also is used when dropping item, and oacket B doesn't have information about the cause of the "hit" animation. Hence this is not fixable by us, by paper, by spigot, by bukkit. Maybe with a modded client implementing your own event & packet, but it is more pain than it is worth

Interestingly enough, the "hit"/PlayerInteractEvent (Packet B) packet does NOT trigger if the player is looking at a block and dropping! a fix can be implemented using packets or placing an invisible block in front of the player (if facing air), I have this in my own plugin, but I figured it may be useful to have in the main plugin hence the request!~

hahahah gaslighting the client that sounds cool, why don't you PR the fix then? or is it another plugin that fixes said issue in such a way?

Because I'm not sure if my fix is good enough xD It's a fix in my own plugin that listens to the pilot tool drop & places a barrier (then removes it quickly), but I bet talented dev could do this via packets, removing the issue somehow without the chance to place permanent barrier blocks, as I have no experience with packets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues causing negative effects for end users
Projects
Status: Waiting for Replication
Development

No branches or pull requests

3 participants