Interface ContainerEventHandler
- All Superinterfaces:
GuiEventListener
,TabOrderedElement
- All Known Implementing Classes:
AbstractCommandBlockEditScreen
,AbstractContainerEventHandler
,AbstractContainerScreen
,AbstractContainerWidget
,AbstractFurnaceScreen
,AbstractReportScreen
,AbstractReportScreen.DiscardReportWarningScreen
,AbstractSelectionList
,AbstractSignEditScreen
,AbstractTestScreen
,AbstractTestScreen.GroupableList
,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
,ContainerTypeTest.TestGui
,ControlsScreen
,CrafterScreen
,CraftingScreen
,CreateBuffetWorldScreen
,CreateBuffetWorldScreen.BiomeList
,CreateFlatWorldScreen
,CreateFlatWorldScreen.DetailsList
,CreateWorldScreen
,CreativeModeInventoryScreen
,CreditsAndAttributionScreen
,CustomPresetEditorTest.SwampDesertScreen
,CustomTooltipTest.TooltipTestScreen
,DatapackLoadFailureScreen
,DeathScreen
,DeathScreen.TitleConfirmScreen
,DemoIntroScreen
,DimensionTransitionScreenTests.CustomLevelScreen
,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
,GuiTests.TestLayer
,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
,RecipeBookTestScreen
,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
,TestScreen
,TestScreen
,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 boolean
charTyped
(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.List
<? extends GuiEventListener> children()
default Optional
<GuiEventListener> getChildAt
(double pMouseX, double pMouseY) Returns the first event listener that intersects with the mouse coordinates.default ComponentPath
private ComponentPath
handleArrowNavigation
(FocusNavigationEvent.ArrowNavigation pArrowNavigation) Handles arrow-based navigation events.private ComponentPath
handleTabNavigation
(FocusNavigationEvent.TabNavigation pTabNavigation) Handles tab-based navigation events.boolean
default boolean
default boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.default boolean
keyReleased
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is released within the GUI element.default boolean
mouseClicked
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.default boolean
mouseDragged
(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.default boolean
mouseReleased
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is released within the GUI element.default boolean
mouseScrolled
(double pMouseX, double pMouseY, double pScrollX, double pScrollY) default ComponentPath
nextFocusPath
(FocusNavigationEvent pEvent) Retrieves the next focus path based on the given focus navigation event.private ComponentPath
nextFocusPathInDirection
(ScreenRectangle pRectangle, ScreenDirection pDirection, GuiEventListener pListener, FocusNavigationEvent pEvent) Calculates the next focus path in a specific direction.private ComponentPath
nextFocusPathVaguelyInDirection
(ScreenRectangle pRectangle, ScreenDirection pDirection, GuiEventListener pListener, FocusNavigationEvent pEvent) Calculates the next focus path in a vague direction.void
setDragging
(boolean pIsDragging) Sets if the GUI element is dragging or not.default void
setFocused
(boolean pFocused) Sets the focus state of the GUI element.void
setFocused
(GuiEventListener pFocused) Sets the focus state of the GUI element.Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMoved
Methods 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 pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClicked
in interfaceGuiEventListener
- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseReleased
default boolean mouseReleased(double pMouseX, double pMouseY, int pButton) Called when a mouse button is released within the GUI element.- Specified by:
mouseReleased
in interfaceGuiEventListener
- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that was released.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseDragged
default boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.- Specified by:
mouseDragged
in interfaceGuiEventListener
- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that is being dragged.pDragX
- the X distance of the drag.pDragY
- the Y distance of the drag.- Returns:
true
if the event is consumed,false
otherwise.
-
isDragging
boolean isDragging() -
setDragging
void setDragging(boolean pIsDragging) Sets if the GUI element is dragging or not.- Parameters:
pIsDragging
- the dragging state of the GUI element.
-
mouseScrolled
default boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY) - Specified by:
mouseScrolled
in interfaceGuiEventListener
-
keyPressed
default boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceGuiEventListener
- Parameters:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
keyReleased
default boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is released within the GUI element.- Specified by:
keyReleased
in interfaceGuiEventListener
- Parameters:
pKeyCode
- the key code of the released key.pScanCode
- the scan code of the released key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
charTyped
default boolean charTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.- Specified by:
charTyped
in interfaceGuiEventListener
- Parameters:
pCodePoint
- the code point of the typed character.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
getFocused
-
setFocused
Sets the focus state of the GUI element.- Parameters:
pFocused
- the focused GUI element.
-
setFocused
default void setFocused(boolean pFocused) Sets the focus state of the GUI element.- Specified by:
setFocused
in interfaceGuiEventListener
- Parameters:
pFocused
-true
to apply focus,false
to remove focus
-
isFocused
default boolean isFocused()- Specified by:
isFocused
in interfaceGuiEventListener
-
getCurrentFocusPath
- Specified by:
getCurrentFocusPath
in interfaceGuiEventListener
-