Interface IClientMobEffectExtensions
public interface IClientMobEffectExtensions
Client-only extensions to
MobEffect
.- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isVisibleInGui
(MobEffectInstance instance) Queries whether the given effect should be shown in the HUD.default boolean
isVisibleInInventory
(MobEffectInstance instance) Queries whether the given effect should be shown in the player's inventory.static IClientMobEffectExtensions
static IClientMobEffectExtensions
of
(MobEffectInstance instance) 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.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.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.
-
Field Details
-
DEFAULT
-
-
Method Details
-
of
-
of
-
isVisibleInInventory
Queries whether the given effect should be shown in the player's inventory.By default, this returns
true
. -
isVisibleInGui
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 instancescreen
- The effect-rendering screenposeStack
- The pose stackx
- The x coordinatey
- The y coordinateblitOffset
- 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 instancescreen
- The effect-rendering screenposeStack
- The pose stackx
- The x coordinatey
- The y coordinateblitOffset
- 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 instancegui
- The guiposeStack
- The pose stackx
- The x coordinatey
- The y coordinatez
- The z depthalpha
- The alpha value. Blinks when the effect is about to run out- Returns:
- true to prevent default rendering, false otherwise
-