Jump to content

[SOLVED][1.21.8 | Forge 58.0.5] How to cancel InputEvent.MouseScrollingEvent?


Recommended Posts

Posted (edited)

On Forge 58.0.5 (MC 1.21.8), InputEvent.MouseScrollingEvent is marked cancellable (implements Cancellable, uses a CancellableEventBus), but the event type does not expose setCanceled(boolean) or cancel() from a @SubscribeEvent listener.

What’s the correct way to cancel this event (or otherwise block vanilla scroll behavior) from mod code?

Can someone plz point me in the right direction?

Thx

Edited by Zacomat
solved
Posted

Forge for 1.21.6 and newer uses EventBus 7, which is a major rewrite. You can read the migration guide here, this explains how to cancel events.

  • Like 2

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Zacomat changed the title to [SOLVED][1.21.8 | Forge 58.0.5] How to cancel InputEvent.MouseScrollingEvent?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.