Package net.minecraftforge.client.event
Class ScreenEvent.RenderInventoryMobEffects
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ScreenEvent
net.minecraftforge.client.event.ScreenEvent.RenderInventoryMobEffects
- Enclosing class:
ScreenEvent
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 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.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
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
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.minecraftforge.client.event.ScreenEvent
getScreen
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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.
-