Interface IClientMobEffectExtensions


public interface IClientMobEffectExtensions
Client-only extensions to MobEffect
See Also:
  • Field Details

  • Method Details

    • of

    • of

    • isVisibleInInventory

      default boolean isVisibleInInventory(MobEffectInstance instance)
      Returns:
      whether the given effect should be shown in the player's inventory. By default, this returns true.
    • isVisibleInGui

      default boolean isVisibleInGui(MobEffectInstance instance)
      Returns:
      whether the given effect should be shown in the HUD. By default, this returns true.
    • extractInventoryIcon

      default boolean extractInventoryIcon(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color)
      Renders the icon of the specified effect in the player's inventory.
      Parameters:
      instance - The effect instance
      screen - The effect-rendering screen
      graphics - The gui graphics
      x - The x coordinate to render at
      y - The y coordinate to render at
      width - Available width of canvas to render in
      height - Available height of canvas to render in
      color - Color multiplicator of the icon
      Returns:
      true to prevent default rendering, false otherwise
    • extractInventoryText

      default boolean extractInventoryText(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int canvasWidth, int color)
      Renders the text of the specified effect in the player's inventory.
      Parameters:
      instance - The effect instance
      screen - The effect-rendering screen
      graphics - The gui graphics
      x - The x coordinate
      y - The y coordinate
      canvasWidth - Available pixels, where rendering anything wider than this amount of pixels may overlap with other GUI elements or go out of bounds
      color - Desired color of text, serving as a hint of best color to use for it to be distinct from background
      Returns:
      true to prevent default rendering, false otherwise
    • extractHudIcon

      default boolean extractHudIcon(MobEffectInstance instance, Hud hud, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color)
      Renders the icon of the specified effect on the player's HUD. This can be used to render icons from your own texture sheet.
      Parameters:
      instance - The effect instance
      hud - The HUD
      graphics - The gui graphics
      x - The x coordinate
      y - The y coordinate
      width - Available width of canvas to render in
      height - Available height of canvas to render in
      color - Color multiplicator of the icon
      Returns:
      true to prevent default rendering, false otherwise