Class ScreenEvent.Init
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ScreenEvent
net.neoforged.neoforge.client.event.ScreenEvent.Init
- Direct Known Subclasses:
ScreenEvent.Init.Post,ScreenEvent.Init.Pre
- Enclosing class:
ScreenEvent
Fired when a screen is being initialized.
See the two subclasses for listening before and after the initialization.
Listeners added through this event may also be marked as renderable or narratable, if they inherit from
Renderable and NarratableEntry
respectively.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFired after the screen's overridable initialization method is called.static classFired before the screen's overridable initialization method is fired.Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.ScreenEvent
ScreenEvent.BackgroundRendered, ScreenEvent.CharacterTyped, ScreenEvent.Closing, ScreenEvent.Init, ScreenEvent.KeyPressed, ScreenEvent.KeyReleased, ScreenEvent.MouseButtonPressed, ScreenEvent.MouseButtonReleased, ScreenEvent.MouseDragged, ScreenEvent.MouseScrolled, ScreenEvent.Opening, ScreenEvent.Render, ScreenEvent.RenderInventoryMobEffects -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Consumer<GuiEventListener> private final List<GuiEventListener> private final Consumer<GuiEventListener> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInit(Screen screen, List<GuiEventListener> listenerList, Consumer<GuiEventListener> add, Consumer<GuiEventListener> remove) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(GuiEventListener listener) Adds the givenGuiEventListenerto the screen.Returns unmodifiable view of list of event listeners on the screen.voidremoveListener(GuiEventListener listener) Removes the givenGuiEventListenerfrom the screen.Methods inherited from class net.neoforged.neoforge.client.event.ScreenEvent
getScreen
-
Field Details
-
add
-
remove
-
listenerList
-
-
Constructor Details
-
Init
@Internal protected Init(Screen screen, List<GuiEventListener> listenerList, Consumer<GuiEventListener> add, Consumer<GuiEventListener> remove)
-
-
Method Details
-
getListenersList
Returns unmodifiable view of list of event listeners on the screen.- Returns:
- unmodifiable view of list of event listeners on the screen
-
addListener
Adds the givenGuiEventListenerto the screen.- Parameters:
listener- the listener to add
-
removeListener
Removes the givenGuiEventListenerfrom the screen.- Parameters:
listener- the listener to remove
-