Search In
• More options...
Find results that contain...
Find results in...

Cancel key press

Recommended Posts

I tried to set the 'pressed' value of the keyBindAttack binding to false via setKeyBindState during Key/MouseInputEvent as well as in the START phase of ClientTickEvent, but it doesn't cancel the clicking for some reason. How does it work?

Edit: I think the problem is that the pressed value is assigned after the START and before END phase of client-tick, so the value specified in START just gets overridden.

In case of keyBindAttack, it's possible to set Minecraft#leftClickCounter to something greater than 1 via reflection (very hacky D:), as this needs to be 0 (and gets reduced by 1 every tick) for attacking/breaking to be effective.

Share on other sites

At least mouse input can be canceled via the

MouseEvent

class.

Share on other sites

Is there something like this for Keys aswell? It's probably rare, but the player might change the binding to a key. If not, I can just find out if it's bound to a key or the mouse (mouse has negative keyCode) and use the reflection-method for keys.

Share on other sites

Looking at the code, there is not a similar event for keys.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• Posts

• How did you figure out the texture changing? I looked at your code and I can't seem to replicate your solution.
• I don't know what to tell you. I don't use iOS devices. Try to find something on your system that is doing the MITM.
• some mods you have installs required another mod, the screen of the game tells you exactly which mod with which version you need to install Edit: mods you need to install supermartijn642corelib 1.0.15 or above puzzleslib 3.0.0 or above placebo 6.0.1 or above terrablender 1.0.0.44 or above blueprint 1.18.1-5.0.0 or above selene 1.18-1.11 or above

• 8
• 0
• 2
• 14
• 3
• Who's Online (See full list)

×

• Activity

×
• Create New...