Interface IClientMobEffectExtensions


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

  • Method Details

    • of

    • of

    • isVisibleInInventory

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

      By default, this returns true.

    • isVisibleInGui

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

      By default, this returns true.

    • renderInventoryIcon

      default boolean renderInventoryIcon(MobEffectInstance instance, EffectRenderingInventoryScreen<?> screen, PoseStack poseStack, 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
      poseStack - The pose stack
      x - The x coordinate
      y - The y coordinate
      blitOffset - The blit offset
      Returns:
      true to prevent default rendering, false otherwise
    • renderInventoryText

      default boolean renderInventoryText(MobEffectInstance instance, EffectRenderingInventoryScreen<?> screen, PoseStack poseStack, 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
      poseStack - The pose stack
      x - The x coordinate
      y - The y coordinate
      blitOffset - The blit offset
      Returns:
      true to prevent default rendering, false otherwise
    • renderGuiIcon

      default boolean renderGuiIcon(MobEffectInstance instance, Gui gui, PoseStack poseStack, 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
      poseStack - The pose stack
      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