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
.
Cancelling this event will prevent vanilla rendering.invalid reference
have a result
This event is fired on the main Forge event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.ScreenEvent
ScreenEvent.BackgroundRendered, ScreenEvent.CharacterTyped, ScreenEvent.Closing, ScreenEvent.Init, ScreenEvent.KeyPressed, ScreenEvent.KeyReleased, ScreenEvent.MouseButtonPressed, ScreenEvent.MouseButtonReleased, ScreenEvent.MouseDragged, ScreenEvent.MouseScrolled, ScreenEvent.Opening, ScreenEvent.Render, ScreenEvent.RenderInventoryMobEffects
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
private boolean
private int
-
Constructor Summary
ConstructorDescriptionRenderInventoryMobEffects
(Screen screen, int availableSpace, boolean compact, int horizontalOffset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHorizontalOffset
(int offset) Adds to the horizontal offset of the effect stack.int
The available space to the right of the inventory.int
The distance from the left side of the screen that the effect stack is rendered.boolean
Whether the effects should be rendered in compact mode (only icons, no text), or the default full size.void
setCompact
(boolean compact) Sets whether the effects should be rendered in compact mode (only icons, no text), or the default full size.void
setHorizontalOffset
(int offset) Replaces the horizontal offset of the effect stackMethods inherited from class net.neoforged.neoforge.client.event.ScreenEvent
getScreen
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
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.
-