Interface IScreenAddon

All Superinterfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement
All Known Implementing Classes:
ArrowButtonScreenAddon, AssetScreenAddon, BasicButtonAddon, BasicScreenAddon, ColorPickerAddon, DragPanelScreenAddon, EnergyBarScreenAddon, FacingHandlerScreenAddon, HuePickerAddon, ItemstackFilterScreenAddon, LockableOverlayAddon, ProgressBarScreenAddon, ShadePickerAddon, SlotsScreenAddon, StateButtonAddon, TankScreenAddon, TextFieldScreenAddon, TextScreenAddon, WidgetScreenAddon

public interface IScreenAddon extends net.minecraft.client.gui.components.events.GuiEventListener
  • Field Summary

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    charTyped(char codePoint, int modifiers)
    Called when a specific 'Character' is typed
    void
    drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
    Draws the component in the background layer
    void
    drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
    Draws the component in the foreground layer
    default List<net.minecraft.network.chat.Component>
    A list of strings that will be drawn as a tooltip when `isInside` returns true
    default void
    init(int screenX, int screenY)
    Called when init is called in the screen.
    default boolean
     
    boolean
     
    default boolean
    isMouseOver(double mouseX, double mouseY)
    Checks whether the mouse if over a specific object or point
    default boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
    Called when a key is pressed
    default boolean
    keyReleased(int keyCode, int scanCode, int modifiers)
    Called when a key is pressed
    default boolean
    mouseClicked(double mouseX, double mouseY, int button)
    Called when a mouse button is clicked
    default boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
    Called when the mouse is pressed and dragged
    default void
    mouseMoved(double xPos, double yPos)
    Called when the mouse is moved.
    default boolean
    mouseReleased(double mouseX, double mouseY, int button)
    Called when the mouse button is released
    default boolean
    mouseScrolled(double mouseX, double mouseY, double delta)
    Called when mouse scroll is applied
    void
    setFocused(boolean focus)
    Called when Screen Focus changes

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    getCurrentFocusPath, getRectangle, nextFocusPath

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Method Details

    • drawBackgroundLayer

      void drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
      Draws the component in the background layer
      Parameters:
      guiGraphics -
      screen - The current open screen
      provider - The current asset provider used in the GUI
      guiX - The gui X in the top left corner
      guiY - The gui Y in the top left corner
      mouseX - The current mouse X
      mouseY - The current mouse Y
      partialTicks - Partial ticks
    • drawForegroundLayer

      void drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
      Draws the component in the foreground layer
      Parameters:
      guiGraphics -
      screen - The current open screen
      provider - The current asset provider used in the GUI
      guiX - The gui X in the top left corner
      guiY - The gui Y in the top left corner
      mouseX - The current mouse X
      mouseY - The current mouse Y
      partialTicks - Partial Ticks
    • getTooltipLines

      default List<net.minecraft.network.chat.Component> getTooltipLines()
      A list of strings that will be drawn as a tooltip when `isInside` returns true
      Returns:
      Returns a list of tooltip lines represented as Component's
    • init

      default void init(int screenX, int screenY)
      Called when init is called in the screen.
      Parameters:
      screenX - the left point of the Screen
      screenY - the top point of the Screen
    • isBackground

      default boolean isBackground()
      Returns:
      Returns true if the addon is part of the background, background rendering.
    • mouseMoved

      default void mouseMoved(double xPos, double yPos)
      Called when the mouse is moved.
      Specified by:
      mouseMoved in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      xPos - Current mouse coordinate X
      yPos - Current mouse coordinate Y
    • mouseClicked

      default boolean mouseClicked(double mouseX, double mouseY, int button)
      Called when a mouse button is clicked
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      mouseX - The mouse X coordinate where it was clicked
      mouseY - The mouse Y coordinate where it was clicked
      button - The Id of the button that was clicked
      Returns:
      Returns whether the mouse was clicked successfully or not
    • mouseReleased

      default boolean mouseReleased(double mouseX, double mouseY, int button)
      Called when the mouse button is released
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      mouseX - The Mouse's X coordinate where it was released
      mouseY - The Mouse's Y coordinate where it was released
      button - The Id of the mouse button that was released
      Returns:
      Returns true if the mouse button release was handled
    • mouseDragged

      default boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Called when the mouse is pressed and dragged
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      mouseX - The X coordinate of the mouse where the drag was initiated
      mouseY - The Y coordinate of the mouse where the drag was initiated
      button - The Id of the Button that was pressed
      dragX - The X coordinate of the mouse where the drag was finished
      dragY - The Y coordinate of the mouse where the drag was finished
      Returns:
      Returns true if the drag was handled
    • mouseScrolled

      default boolean mouseScrolled(double mouseX, double mouseY, double delta)
      Called when mouse scroll is applied
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      mouseX - The X coordinate of the mouse where the scroll was initiated
      mouseY - The Y coordinate of the mouse where the scroll was initiated
      delta - The scroll wheel delta (Change rate)
      Returns:
      Returns true if the scroll was handled
    • keyPressed

      default boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Called when a key is pressed
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      keyCode - The keyboard key that was pressed or released
      scanCode - The system-specific scancode of the key
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns true if the key press was handled
    • keyReleased

      default boolean keyReleased(int keyCode, int scanCode, int modifiers)
      Called when a key is pressed
      Specified by:
      keyReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      keyCode - The keyboard key that was pressed or released
      scanCode - The system-specific scancode of the key
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns whether the key release was handled
    • charTyped

      default boolean charTyped(char codePoint, int modifiers)
      Called when a specific 'Character' is typed
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      codePoint - The Unicode code point of the character
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns true if the 'Character' being typed was handled
    • isFocused

      boolean isFocused()
      Specified by:
      isFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
    • setFocused

      void setFocused(boolean focus)
      Called when Screen Focus changes
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      focus - If the screen the addon is part of is focused
    • isMouseOver

      default boolean isMouseOver(double mouseX, double mouseY)
      Checks whether the mouse if over a specific object or point
      Specified by:
      isMouseOver in interface net.minecraft.client.gui.components.events.GuiEventListener
      Parameters:
      mouseX - The X position of the mouse
      mouseY - The Y position of the mouse
      Returns:
      Returns true if the mouse if over a specific object or point