Class GuiScreenEvent.MouseReleasedEvent.Post

Enclosing class:
GuiScreenEvent.MouseReleasedEvent

public static class GuiScreenEvent.MouseReleasedEvent.Post extends GuiScreenEvent.MouseReleasedEvent
This event fires after GuiEventListener.mouseReleased(double, double, int).

This event has a result.

  • Event.Result.ALLOW - to force set the mouse release as handled
  • Event.Result.DEFAULT - to use the default value of handled
  • Event.Result.DENY - to force set the mouse release as not handled

Note that this event is currently pre-cancelled if ContainerEventHandler.mouseReleased(double, double, int) returns true to retain old behavior. This will be changed in 1.18 when the event is made non-cancellable.

  • Field Details

    • handled

      private final boolean handled
  • Constructor Details

    • Post

      public Post(Screen gui, double mouseX, double mouseY, int button, boolean handled)
  • Method Details

    • setCanceled

      @Deprecated public void setCanceled(boolean cancel)
      Deprecated.
      event now has a result instead and will no longer be cancellable in 1.18; use Event.setResult(Result)
      Overrides:
      setCanceled in class net.minecraftforge.eventbus.api.Event
    • wasHandled

      public boolean wasHandled()
      Returns:
      true if the mouse release was already handled by its screen