Interface GuiEventListener

All Superinterfaces:
TabOrderedElement
All Known Subinterfaces:
ContainerEventHandler
All Known Implementing Classes:
AbstractButton, AbstractCommandBlockEditScreen, AbstractContainerEventHandler, AbstractContainerScreen, AbstractContainerWidget, AbstractFurnaceScreen, AbstractOptionSliderButton, AbstractRecipeBookScreen, AbstractReportScreen, AbstractReportScreen.DiscardReportWarningScreen, AbstractScrollArea, AbstractSelectionList, AbstractSelectionList.Entry, AbstractSignEditScreen, AbstractSliderButton, AbstractStringWidget, AbstractTextAreaWidget, AbstractWidget, AccessibilityOnboardingScreen, AccessibilityOptionsScreen, AddRealmPopupScreen, AdvancementsScreen, AlertScreen, AnvilScreen, BackupConfirmScreen, BeaconScreen, BeaconScreen.BeaconCancelButton, BeaconScreen.BeaconConfirmButton, BeaconScreen.BeaconPowerButton, BeaconScreen.BeaconScreenButton, BeaconScreen.BeaconSpriteScreenButton, BeaconScreen.BeaconUpgradePowerButton, BlastFurnaceScreen, BookEditScreen, BookSignScreen, BookViewScreen, BrewingStandScreen, Button, ButtonListDialogScreen, CartographyTableScreen, ChatOptionsScreen, ChatReportScreen, ChatScreen, ChatSelectionScreen, ChatSelectionScreen.ChatSelectionList, ChatSelectionScreen.ChatSelectionList.DividerEntry, ChatSelectionScreen.ChatSelectionList.Entry, ChatSelectionScreen.ChatSelectionList.MessageEntry, ChatSelectionScreen.ChatSelectionList.MessageHeadingEntry, ChatSelectionScreen.ChatSelectionList.PaddingEntry, Checkbox, ClientCommonPacketListenerImpl.PackConfirmScreen, CommandBlockEditScreen, ConfigurationScreen, ConfigurationScreen.ConfigurationListScreen, ConfigurationScreen.ConfigurationListScreen.ListLabelWidget, ConfigurationScreen.ConfigurationSectionScreen, ConfigurationScreen.TooltipConfirmScreen, ConfirmExperimentalFeaturesScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen.PackList, ConfirmExperimentalFeaturesScreen.DetailsScreen.PackListEntry, ConfirmLinkScreen, ConfirmScreen, ConnectScreen, ContainerObjectSelectionList, ContainerObjectSelectionList.Entry, ContainerScreen, ControlsScreen, CrafterScreen, CraftingRecipeBookComponent, CraftingScreen, CreateBuffetWorldScreen, CreateBuffetWorldScreen.BiomeList, CreateBuffetWorldScreen.BiomeList.Entry, CreateFlatWorldScreen, CreateFlatWorldScreen.DetailsList, CreateFlatWorldScreen.DetailsList.Entry, CreateWorldScreen, CreativeModeInventoryScreen, CreditsAndAttributionScreen, CycleButton, DatapackLoadFailureScreen, DeathScreen, DeathScreen.TitleConfirmScreen, DemoIntroScreen, DialogListDialogScreen, DialogScreen, DialogScreen.WarningScreen, DirectJoinServerScreen, DisconnectedScreen, DispenserScreen, EditBox, EditGameRulesScreen, EditGameRulesScreen.BooleanRuleEntry, EditGameRulesScreen.CategoryRuleEntry, EditGameRulesScreen.GameRuleEntry, EditGameRulesScreen.IntegerRuleEntry, EditGameRulesScreen.RuleEntry, EditGameRulesScreen.RuleList, EditServerScreen, EditWorldScreen, EnchantmentScreen, ErrorScreen, ExperimentsScreen, ExtendedButton, ExtendedSlider, FittingMultiLineTextWidget, FocusableTextWidget, FontOptionsScreen, FurnaceRecipeBookComponent, FurnaceScreen, GameModeSwitcherScreen, GameModeSwitcherScreen.GameModeSlot, GenericMessageScreen, GenericWaitingScreen, GrindstoneScreen, HangingSignEditScreen, HopperScreen, HorseInventoryScreen, ImageButton, ImageWidget, ImageWidget.Sprite, ImageWidget.Texture, InBedChatScreen, InputControlHandlers.NumberRangeHandler.SliderImpl, InventoryScreen, ItemCombinerScreen, ItemDisplayWidget, JigsawBlockEditScreen, JoinMultiplayerScreen, KeyBindsList, KeyBindsList.CategoryEntry, KeyBindsList.Entry, KeyBindsList.KeyEntry, KeyBindsScreen, LanguageSelectScreen, LanguageSelectScreen.LanguageSelectionList, LanguageSelectScreen.LanguageSelectionList.Entry, LecternScreen, LevelLoadingScreen, LoadingDotsWidget, LoadingErrorScreen, LoadingErrorScreen.LoadingEntryList, LoadingErrorScreen.LoadingEntryList.LoadingMessageEntry, LockIconButton, LoomScreen, MerchantScreen, MerchantScreen.TradeOfferButton, MinecartCommandBlockEditScreen, ModListScreen, ModListScreen.InfoPanel, ModListWidget, ModListWidget.ModEntry, ModMismatchDisconnectedScreen, ModMismatchDisconnectedScreen.MismatchInfoPanel, ModsButton, MouseSettingsScreen, MultiButtonDialogScreen, MultiLineEditBox, MultiLineTextWidget, NameReportScreen, NoticeWithLinkScreen, ObjectSelectionList, ObjectSelectionList.Entry, OnlineOptionsScreen, OptimizeWorldScreen, OptionInstance.OptionInstanceSliderButton, OptionsList, OptionsList.Entry, OptionsList.OptionEntry, OptionsScreen, OptionsSubScreen, OutOfMemoryScreen, OverlayRecipeComponent, OverlayRecipeComponent.OverlayCraftingRecipeButton, OverlayRecipeComponent.OverlayRecipeButton, OverlayRecipeComponent.OverlaySmeltingRecipeButton, PackSelectionScreen, PageButton, PauseScreen, PauseScreen.FeedbackSubScreen, PlainTextButton, PlayerEntry, PlayerSkinWidget, PopupScreen, PresetFlatWorldScreen, PresetFlatWorldScreen.PresetsList, PresetFlatWorldScreen.PresetsList.Entry, ProgressScreen, RealmsBackupInfoScreen, RealmsBackupInfoScreen.BackupInfoList, RealmsBackupInfoScreen.BackupInfoListEntry, RealmsBackupScreen, RealmsBackupScreen.BackupObjectSelectionList, RealmsBackupScreen.Entry, RealmsBrokenWorldScreen, RealmsClientOutdatedScreen, RealmsConfigureWorldScreen, RealmsConfirmScreen, RealmsCreateRealmScreen, RealmsDownloadLatestWorldScreen, RealmsGenericErrorScreen, RealmsInviteScreen, RealmsLongRunningMcoConnectTaskScreen, RealmsLongRunningMcoTaskScreen, RealmsMainScreen, RealmsMainScreen.AvailableSnapshotEntry, RealmsMainScreen.ButtonEntry, RealmsMainScreen.CrossButton, RealmsMainScreen.EmptyEntry, RealmsMainScreen.Entry, RealmsMainScreen.NotificationButton, RealmsMainScreen.NotificationMessageEntry, RealmsMainScreen.ParentEntry, RealmsMainScreen.RealmSelectionList, RealmsMainScreen.ServerEntry, RealmsNotificationsScreen, RealmsParentalConsentScreen, RealmsPendingInvitesScreen, RealmsPendingInvitesScreen.Entry, RealmsPendingInvitesScreen.PendingInvitationSelectionList, RealmsPlayersTab.Entry, RealmsPlayersTab.InvitedObjectSelectionList, RealmsPreferredRegionSelectionScreen, RealmsPreferredRegionSelectionScreen.RegionSelectionList, RealmsPreferredRegionSelectionScreen.RegionSelectionList.Entry, RealmsResetWorldScreen, RealmsResetWorldScreen.FrameButton, RealmsScreen, RealmsSelectFileToUploadScreen, RealmsSelectFileToUploadScreen.Entry, RealmsSelectFileToUploadScreen.WorldSelectionList, RealmsSelectWorldTemplateScreen, RealmsSelectWorldTemplateScreen.Entry, RealmsSelectWorldTemplateScreen.WorldTemplateList, RealmsSlotOptionsScreen, RealmsSlotOptionsScreen.SettingsSlider, RealmsTermsScreen, RealmsUploadScreen, RealmsWorldSlotButton, ReceivingLevelScreen, RecipeBookComponent, RecipeBookTabButton, RecipeButton, RecoverWorldDataScreen, ReportPlayerScreen, ReportReasonSelectionScreen, ReportReasonSelectionScreen.ReasonSelectionList, ReportReasonSelectionScreen.ReasonSelectionList.Entry, SafetyScreen, Screen, ScrollableLayout.Container, ScrollPanel, SelectWorldScreen, ServerLinksDialogScreen, ServerReconfigScreen, ServerSelectionList, ServerSelectionList.Entry, ServerSelectionList.LANHeader, ServerSelectionList.NetworkServerEntry, ServerSelectionList.OnlineServerEntry, ShareToLanScreen, ShulkerBoxScreen, SignEditScreen, SimpleDialogScreen, SkinCustomizationScreen, SkinReportScreen, SmithingScreen, SmokerScreen, SocialInteractionsPlayerList, SocialInteractionsScreen, SoundOptionsScreen, SpriteIconButton, SpriteIconButton.CenteredIcon, SpriteIconButton.TextAndIcon, StateSwitchingButton, StatsScreen, StatsScreen.GeneralStatisticsList, StatsScreen.GeneralStatisticsList.Entry, StatsScreen.ItemStatisticsList, StatsScreen.ItemStatisticsList.ItemRow, StatsScreen.MobsStatisticsList, StatsScreen.MobsStatisticsList.MobRow, StonecutterScreen, StringWidget, StructureBlockEditScreen, TabButton, TabNavigationBar, TelemetryEventWidget, TelemetryInfoScreen, TestBlockEditScreen, TestInstanceBlockEditScreen, TitleScreen, TransferableSelectionList, TransferableSelectionList.PackEntry, UnicodeGlyphButton, UnsupportedGraphicsWarningScreen, VideoSettingsScreen, WaitingForResponseScreen, WarningScreen, WinScreen, WorldSelectionList, WorldSelectionList.Entry, WorldSelectionList.LoadingHeader, WorldSelectionList.WorldListEntry

public interface GuiEventListener extends TabOrderedElement
Represents a listener for GUI events.

It extends the TabOrderedElement interface, providing tab order functionality for GUI components.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    charTyped(char codePoint, int modifiers)
    Called when a character is typed within the GUI element.
     
     
     
    boolean
     
    default boolean
    isMouseOver(double mouseX, double mouseY)
    Checks if the given mouse coordinates are over the GUI element.
    default boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
    Called when a keyboard key is pressed within the GUI element.
    default boolean
    keyReleased(int keyCode, int scanCode, int modifiers)
    Called when a keyboard key is released within the GUI element.
    default boolean
    mouseClicked(double mouseX, double mouseY, int button)
    Called when a mouse button is clicked within the GUI element.
    default boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
    Called when the mouse is dragged within the GUI element.
    default void
    mouseMoved(double mouseX, double mouseY)
    Called when the mouse is moved within the GUI element.
    default boolean
    mouseReleased(double mouseX, double mouseY, int button)
    Called when a mouse button is released within the GUI element.
    default boolean
    mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
     
    Retrieves the next focus path based on the given focus navigation event.
    void
    setFocused(boolean focused)
    Sets the focus state of the GUI element.

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • DOUBLE_CLICK_THRESHOLD_MS

      static final long DOUBLE_CLICK_THRESHOLD_MS
      See Also:
  • Method Details

    • mouseMoved

      default void mouseMoved(double mouseX, double mouseY)
      Called when the mouse is moved within the GUI element.
      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
    • mouseClicked

      default boolean mouseClicked(double mouseX, double mouseY, int button)
      Called when a mouse button is clicked within the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseReleased

      default boolean mouseReleased(double mouseX, double mouseY, int button)
      Called when a mouse button is released within the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was released.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseDragged

      default boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Called when the mouse is dragged within the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that is being dragged.
      dragX - the X distance of the drag.
      dragY - the Y distance of the drag.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseScrolled

      default boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
    • keyPressed

      default boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Called when a keyboard key is pressed within the GUI element.

      Parameters:
      keyCode - the key code of the pressed key.
      scanCode - the scan code of the pressed key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • keyReleased

      default boolean keyReleased(int keyCode, int scanCode, int modifiers)
      Called when a keyboard key is released within the GUI element.

      Parameters:
      keyCode - the key code of the released key.
      scanCode - the scan code of the released key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • charTyped

      default boolean charTyped(char codePoint, int modifiers)
      Called when a character is typed within the GUI element.

      Parameters:
      codePoint - the code point of the typed character.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • nextFocusPath

      @Nullable default ComponentPath nextFocusPath(FocusNavigationEvent event)
      Retrieves the next focus path based on the given focus navigation event.

      Parameters:
      event - the focus navigation event.
      Returns:
      the next focus path as a ComponentPath, or null if there is no next focus path.
    • isMouseOver

      default boolean isMouseOver(double mouseX, double mouseY)
      Checks if the given mouse coordinates are over the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      Returns:
      true if the mouse is over the GUI element, false otherwise.
    • setFocused

      void setFocused(boolean focused)
      Sets the focus state of the GUI element.
      Parameters:
      focused - true to apply focus, false to remove focus
    • isFocused

      boolean isFocused()
    • getCurrentFocusPath

      @Nullable default ComponentPath getCurrentFocusPath()
    • getRectangle

      default ScreenRectangle getRectangle()
    • getBorderForArrowNavigation

      default ScreenRectangle getBorderForArrowNavigation(ScreenDirection direction)