Class ScreenEvent.RenderInventoryMobEffects

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ScreenEvent
net.neoforged.neoforge.client.event.ScreenEvent.RenderInventoryMobEffects
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
ScreenEvent

public static class ScreenEvent.RenderInventoryMobEffects extends ScreenEvent implements net.neoforged.bus.api.ICancellableEvent
Fired ahead of rendering any active mob effects in the inventory screen. Can be used to select the size of the effects display (full or compact) or even hide or replace vanilla's rendering entirely. This event can also be used to modify the horizontal position of the stack of effects being rendered.

This event is cancellable and does not

invalid reference
have a result
. Cancelling this event will prevent vanilla rendering.

This event is fired on the main Forge event bus, only on the logical client.

  • Field Details

    • availableSpace

      private final int availableSpace
    • compact

      private boolean compact
    • horizontalOffset

      private int horizontalOffset
  • Constructor Details

    • RenderInventoryMobEffects

      @Internal public RenderInventoryMobEffects(Screen screen, int availableSpace, boolean compact, int horizontalOffset)
  • Method Details

    • getAvailableSpace

      public int getAvailableSpace()
      The available space to the right of the inventory.
    • isCompact

      public boolean isCompact()
      Whether the effects should be rendered in compact mode (only icons, no text), or the default full size.
    • getHorizontalOffset

      public int getHorizontalOffset()
      The distance from the left side of the screen that the effect stack is rendered. Positive values shift this more to the right.
    • setHorizontalOffset

      public void setHorizontalOffset(int offset)
      Replaces the horizontal offset of the effect stack
    • addHorizontalOffset

      public void addHorizontalOffset(int offset)
      Adds to the horizontal offset of the effect stack. Negative values are acceptable.
    • setCompact

      public void setCompact(boolean compact)
      Sets whether the effects should be rendered in compact mode (only icons, no text), or the default full size.