Class ScreenOpenEvent

java.lang.Object
org.polyfrost.oneconfig.api.event.v1.events.Event.Cancellable
org.polyfrost.oneconfig.api.event.v1.events.ScreenOpenEvent
All Implemented Interfaces:
Event

public class ScreenOpenEvent extends Event.Cancellable
Called when a screen is opened or closed. If the screen is closed, screen will be null.
  • Constructor Details

    • ScreenOpenEvent

      public ScreenOpenEvent(@Nullable @Nullable Object screen)
  • Method Details

    • getScreen

      @Nullable public <T> T getScreen()
      Due to differences across Minecraft versions, this is a Duck method, meaning that it will return the expected type for that minecraft version.
      • For legacy forge, this will be a GuiScreen.
      • For modern forge, this will be a Screen.
      • For fabric, this will be a Screen.
    • component1

      @Nullable public @Nullable Object component1()