java.lang.Object
net.fabricmc.fabric.api.client.screen.v1.Screens

@Environment(CLIENT) public final class Screens extends Object
Utility methods related to screens.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<net.minecraft.client.gui.widget.ClickableWidget>
    getButtons(net.minecraft.client.gui.screen.Screen screen)
    Gets all of a screen's button widgets.
    static net.minecraft.client.MinecraftClient
    getClient(net.minecraft.client.gui.screen.Screen screen)
     
    static net.minecraft.client.render.item.ItemRenderer
    getItemRenderer(net.minecraft.client.gui.screen.Screen screen)
    Gets a screen's item renderer.
    static net.minecraft.client.font.TextRenderer
    getTextRenderer(net.minecraft.client.gui.screen.Screen screen)
    Gets a screen's text renderer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getButtons

      public static List<net.minecraft.client.gui.widget.ClickableWidget> getButtons(net.minecraft.client.gui.screen.Screen screen)
      Gets all of a screen's button widgets. The provided list allows for addition and removal of buttons from the screen. This method should be preferred over adding buttons directly to a screen's child elements.
      Returns:
      a list of all of a screen's buttons
    • getItemRenderer

      public static net.minecraft.client.render.item.ItemRenderer getItemRenderer(net.minecraft.client.gui.screen.Screen screen)
      Gets a screen's item renderer.
      Returns:
      the screen's item renderer
    • getTextRenderer

      public static net.minecraft.client.font.TextRenderer getTextRenderer(net.minecraft.client.gui.screen.Screen screen)
      Gets a screen's text renderer.
      Returns:
      the screen's text renderer.
    • getClient

      public static net.minecraft.client.MinecraftClient getClient(net.minecraft.client.gui.screen.Screen screen)