Interface ContainerEventHandler
- All Superinterfaces:
GuiEventListener,TabOrderedElement
- All Known Implementing Classes:
AbstractCommandBlockEditScreen,AbstractContainerEventHandler,AbstractContainerScreen,AbstractContainerWidget,AbstractFurnaceScreen,AbstractReportScreen,AbstractReportScreen.DiscardReportWarningScreen,AbstractSelectionList,AbstractSignEditScreen,AccessibilityOnboardingScreen,AccessibilityOptionsScreen,AddRealmPopupScreen,AdvancementsScreen,AlertScreen,AnvilScreen,BackupConfirmScreen,BeaconScreen,BlastFurnaceScreen,BookEditScreen,BookViewScreen,BrewingStandScreen,CartographyTableScreen,ChatOptionsScreen,ChatReportScreen,ChatScreen,ChatSelectionScreen,ChatSelectionScreen.ChatSelectionList,ClientCommonPacketListenerImpl.PackConfirmScreen,CommandBlockEditScreen,ConfigurationScreen,ConfigurationScreen.ConfigurationListScreen,ConfigurationScreen.ConfigurationListScreen.ListLabelWidget,ConfigurationScreen.ConfigurationSectionScreen,ConfigurationScreen.TooltipConfirmScreen,ConfirmExperimentalFeaturesScreen,ConfirmExperimentalFeaturesScreen.DetailsScreen,ConfirmExperimentalFeaturesScreen.DetailsScreen.PackList,ConfirmLinkScreen,ConfirmScreen,ConnectScreen,ContainerObjectSelectionList,ContainerObjectSelectionList.Entry,ContainerScreen,ControlsScreen,CrafterScreen,CraftingScreen,CreateBuffetWorldScreen,CreateBuffetWorldScreen.BiomeList,CreateFlatWorldScreen,CreateFlatWorldScreen.DetailsList,CreateWorldScreen,CreativeModeInventoryScreen,CreditsAndAttributionScreen,DatapackLoadFailureScreen,DeathScreen,DeathScreen.TitleConfirmScreen,DemoIntroScreen,DirectJoinServerScreen,DisconnectedRealmsScreen,DisconnectedScreen,DispenserScreen,EditGameRulesScreen,EditGameRulesScreen.BooleanRuleEntry,EditGameRulesScreen.CategoryRuleEntry,EditGameRulesScreen.GameRuleEntry,EditGameRulesScreen.IntegerRuleEntry,EditGameRulesScreen.RuleEntry,EditGameRulesScreen.RuleList,EditServerScreen,EditWorldScreen,EffectRenderingInventoryScreen,EnchantmentScreen,ErrorScreen,ExperimentsScreen,FontOptionsScreen,FurnaceScreen,GameModeSwitcherScreen,GenericMessageScreen,GenericWaitingScreen,GrindstoneScreen,HangingSignEditScreen,HopperScreen,HorseInventoryScreen,InBedChatScreen,InventoryScreen,ItemCombinerScreen,JigsawBlockEditScreen,JoinMultiplayerScreen,KeyBindsList,KeyBindsList.CategoryEntry,KeyBindsList.Entry,KeyBindsList.KeyEntry,KeyBindsScreen,LanguageSelectScreen,LanguageSelectScreen.LanguageSelectionList,LecternScreen,LevelLoadingScreen,LoadingErrorScreen,LoadingErrorScreen.LoadingEntryList,LoomScreen,MerchantScreen,MinecartCommandBlockEditScreen,ModListScreen,ModListScreen.InfoPanel,ModListWidget,ModMismatchDisconnectedScreen,ModMismatchDisconnectedScreen.MismatchInfoPanel,MouseSettingsScreen,NameReportScreen,NoticeWithLinkScreen,ObjectSelectionList,OnlineOptionsScreen,OptimizeWorldScreen,OptionsList,OptionsList.Entry,OptionsList.OptionEntry,OptionsScreen,OptionsSubScreen,OutOfMemoryScreen,PackSelectionScreen,PauseScreen,PauseScreen.FeedbackSubScreen,PlayerEntry,PopupScreen,PresetFlatWorldScreen,PresetFlatWorldScreen.PresetsList,ProgressScreen,RealmsBackupInfoScreen,RealmsBackupInfoScreen.BackupInfoList,RealmsBackupScreen,RealmsBackupScreen.BackupObjectSelectionList,RealmsBackupScreen.Entry,RealmsBrokenWorldScreen,RealmsClientOutdatedScreen,RealmsConfigureWorldScreen,RealmsConfirmScreen,RealmsCreateRealmScreen,RealmsDownloadLatestWorldScreen,RealmsGenericErrorScreen,RealmsInviteScreen,RealmsLongRunningMcoTaskScreen,RealmsLongRunningMcoTickTaskScreen,RealmsMainScreen,RealmsMainScreen.RealmSelectionList,RealmsNotificationsScreen,RealmsObjectSelectionList,RealmsParentalConsentScreen,RealmsPendingInvitesScreen,RealmsPendingInvitesScreen.PendingInvitationSelectionList,RealmsPlayerScreen,RealmsPlayerScreen.Entry,RealmsPlayerScreen.InvitedObjectSelectionList,RealmsResetNormalWorldScreen,RealmsResetWorldScreen,RealmsScreen,RealmsSelectFileToUploadScreen,RealmsSelectFileToUploadScreen.WorldSelectionList,RealmsSelectWorldTemplateScreen,RealmsSelectWorldTemplateScreen.WorldTemplateList,RealmsSettingsScreen,RealmsSlotOptionsScreen,RealmsSubscriptionInfoScreen,RealmsTermsScreen,RealmsUploadScreen,ReceivingLevelScreen,RecoverWorldDataScreen,ReportPlayerScreen,ReportReasonSelectionScreen,ReportReasonSelectionScreen.ReasonSelectionList,SafetyScreen,Screen,ScrollableExperimentsScreen,ScrollableExperimentsScreen.ExperimentSelectionList,ScrollableExperimentsScreen.ExperimentSelectionList.ExperimentEntry,ScrollPanel,SelectWorldScreen,ServerLinksScreen,ServerLinksScreen.LinkList,ServerLinksScreen.LinkListEntry,ServerReconfigScreen,ServerSelectionList,ShareToLanScreen,ShulkerBoxScreen,SignEditScreen,SkinCustomizationScreen,SkinReportScreen,SmithingScreen,SmokerScreen,SocialInteractionsPlayerList,SocialInteractionsScreen,SoundOptionsScreen,StatsScreen,StatsScreen.GeneralStatisticsList,StatsScreen.ItemStatisticsList,StatsScreen.MobsStatisticsList,StonecutterScreen,StructureBlockEditScreen,TabNavigationBar,TelemetryInfoScreen,TitleScreen,TransferableSelectionList,UnsupportedGraphicsWarningScreen,VideoSettingsScreen,WarningScreen,WinScreen,WorldSelectionList
-
Field Summary
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancharTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.List<? extends GuiEventListener> children()default Optional<GuiEventListener> getChildAt(double mouseX, double mouseY) Returns the first event listener that intersects with the mouse coordinates.default ComponentPathprivate ComponentPathhandleArrowNavigation(FocusNavigationEvent.ArrowNavigation arrowNavigation) Handles arrow-based navigation events.private ComponentPathhandleTabNavigation(FocusNavigationEvent.TabNavigation tabNavigation) Handles tab-based navigation events.booleandefault booleandefault booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.default booleankeyReleased(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.default booleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.default booleanmouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.default booleanmouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.default booleanmouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) default ComponentPathRetrieves the next focus path based on the given focus navigation event.private ComponentPathnextFocusPathInDirection(ScreenRectangle rectangle, ScreenDirection direction, GuiEventListener listener, FocusNavigationEvent event) Calculates the next focus path in a specific direction.private ComponentPathnextFocusPathVaguelyInDirection(ScreenRectangle rectangle, ScreenDirection direction, GuiEventListener listener, FocusNavigationEvent event) Calculates the next focus path in a vague direction.voidsetDragging(boolean isDragging) Sets if the GUI element is dragging or not.default voidsetFocused(boolean focused) Sets the focus state of the GUI element.voidsetFocused(GuiEventListener focused) Sets the focus state of the GUI element.Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Method Details
-
children
List<? extends GuiEventListener> children() -
getChildAt
Returns the first event listener that intersects with the mouse coordinates. -
mouseClicked
default boolean mouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceGuiEventListener- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseReleased
default boolean mouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.- Specified by:
mouseReleasedin interfaceGuiEventListener- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was released.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseDragged
default boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceGuiEventListener- 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:
trueif the event is consumed,falseotherwise.
-
isDragging
boolean isDragging() -
setDragging
void setDragging(boolean isDragging) Sets if the GUI element is dragging or not.- Parameters:
isDragging- the dragging state of the GUI element.
-
mouseScrolled
default boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) - Specified by:
mouseScrolledin interfaceGuiEventListener
-
keyPressed
default boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceGuiEventListener- Parameters:
keyCode- the key code of the pressed key.scanCode- the scan code of the pressed key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyReleased
default boolean keyReleased(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.- Specified by:
keyReleasedin interfaceGuiEventListener- Parameters:
keyCode- the key code of the released key.scanCode- the scan code of the released key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
charTyped
default boolean charTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.- Specified by:
charTypedin interfaceGuiEventListener- Parameters:
codePoint- the code point of the typed character.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
getFocused
-
setFocused
Sets the focus state of the GUI element.- Parameters:
focused- the focused GUI element.
-
setFocused
default void setFocused(boolean focused) Sets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Parameters:
focused-trueto apply focus,falseto remove focus
-
isFocused
default boolean isFocused()- Specified by:
isFocusedin interfaceGuiEventListener
-
getCurrentFocusPath
- Specified by:
getCurrentFocusPathin interfaceGuiEventListener
-