Package net.minecraftforge.client.event
Class ScreenEvent.Opening
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ScreenEvent
net.minecraftforge.client.event.ScreenEvent.Opening
- Enclosing class:
ScreenEvent
Fired before any
Screen
is opened, to allow changing it or preventing it from being opened.
All screen layers on the screen are closed before this event is fired.
This event is cancellable, and does not have a result.
If this event is cancelled, then the Screen
shall be prevented from opening and any previous screen
will remain open. However, cancelling this event will not prevent the closing of screen layers which happened before
this event fired.
This event is fired on the main Forge event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.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
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Screen
Gets the currently open screen at the time of the event being fired.@Nullable Screen
void
setNewScreen
(Screen newScreen) Sets the new screen to be opened if the event is not cancelled.Methods inherited from class net.minecraftforge.client.event.ScreenEvent
getScreen
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
currentScreen
-
newScreen
-
-
Constructor Details
-
Opening
-
-
Method Details
-
getCurrentScreen
Gets the currently open screen at the time of the event being fired.May be null if no screen was open.
-
getNewScreen
- Returns:
- The screen that will be opened if the event is not cancelled. May be null.
-
setNewScreen
Sets the new screen to be opened if the event is not cancelled. May be null.
-