Interface IClientMobEffectExtensions


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

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    isVisibleInGui(net.minecraft.world.effect.MobEffectInstance instance)
    Queries whether the given effect should be shown in the HUD.
    default boolean
    isVisibleInInventory(net.minecraft.world.effect.MobEffectInstance instance)
    Queries whether the given effect should be shown in the player's inventory.
    of(net.minecraft.world.effect.MobEffect effect)
     
    of(net.minecraft.world.effect.MobEffectInstance instance)
     
    default boolean
    renderGuiIcon(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.Gui gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, float z, float alpha)
    Renders the icon of the specified effect on the player's HUD.
    default boolean
    renderInventoryIcon(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<?> screen, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int blitOffset)
    Renders the icon of the specified effect in the player's inventory.
    default boolean
    renderInventoryText(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<?> screen, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int blitOffset)
    Renders the text of the specified effect in the player's inventory.
  • Field Details

  • Method Details

    • of

      static IClientMobEffectExtensions of(net.minecraft.world.effect.MobEffectInstance instance)
    • of

      static IClientMobEffectExtensions of(net.minecraft.world.effect.MobEffect effect)
    • isVisibleInInventory

      default boolean isVisibleInInventory(net.minecraft.world.effect.MobEffectInstance instance)
      Queries whether the given effect should be shown in the player's inventory.

      By default, this returns true.

    • isVisibleInGui

      default boolean isVisibleInGui(net.minecraft.world.effect.MobEffectInstance instance)
      Queries whether the given effect should be shown in the HUD.

      By default, this returns true.

    • renderInventoryIcon

      default boolean renderInventoryIcon(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<?> screen, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int blitOffset)
      Renders the icon of the specified effect in the player's inventory. This can be used to render icons from your own texture sheet.
      Parameters:
      instance - The effect instance
      screen - The effect-rendering screen
      guiGraphics - The gui graphics
      x - The x coordinate
      y - The y coordinate
      blitOffset - The blit offset
      Returns:
      true to prevent default rendering, false otherwise
    • renderInventoryText

      default boolean renderInventoryText(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<?> screen, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int blitOffset)
      Renders the text of the specified effect in the player's inventory.
      Parameters:
      instance - The effect instance
      screen - The effect-rendering screen
      guiGraphics - The gui graphics
      x - The x coordinate
      y - The y coordinate
      blitOffset - The blit offset
      Returns:
      true to prevent default rendering, false otherwise
    • renderGuiIcon

      default boolean renderGuiIcon(net.minecraft.world.effect.MobEffectInstance instance, net.minecraft.client.gui.Gui gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, float z, float alpha)
      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
      gui - The gui
      guiGraphics - The gui graphics
      x - The x coordinate
      y - The y coordinate
      z - The z depth
      alpha - The alpha value. Blinks when the effect is about to run out
      Returns:
      true to prevent default rendering, false otherwise