Interface IClientMobEffectExtensions
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanextractHudIcon(MobEffectInstance instance, Hud hud, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color) Renders the icon of the specified effect on the player's HUD.default booleanextractInventoryIcon(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color) Renders the icon of the specified effect in the player's inventory.default booleanextractInventoryText(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int canvasWidth, int color) Renders the text of the specified effect in the player's inventory.default booleanisVisibleInGui(MobEffectInstance instance) default booleanisVisibleInInventory(MobEffectInstance instance) static IClientMobEffectExtensionsstatic IClientMobEffectExtensionsof(MobEffectInstance instance)
-
Field Details
-
DEFAULT
-
-
Method Details
-
of
-
of
-
isVisibleInInventory
- Returns:
- whether the given effect should be shown in the player's inventory.
By default, this returns
true.
-
isVisibleInGui
- Returns:
- whether the given effect should be shown in the HUD.
By default, this returns
true.
-
extractInventoryIcon
default boolean extractInventoryIcon(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color) Renders the icon of the specified effect in the player's inventory.- Parameters:
instance- The effect instancescreen- The effect-rendering screengraphics- The gui graphicsx- The x coordinate to render aty- The y coordinate to render atwidth- Available width of canvas to render inheight- Available height of canvas to render incolor- Color multiplicator of the icon- Returns:
trueto prevent default rendering,falseotherwise
-
extractInventoryText
default boolean extractInventoryText(MobEffectInstance instance, AbstractContainerScreen<?> screen, GuiGraphicsExtractor graphics, int x, int y, int canvasWidth, int color) Renders the text of the specified effect in the player's inventory.- Parameters:
instance- The effect instancescreen- The effect-rendering screengraphics- The gui graphicsx- The x coordinatey- The y coordinatecanvasWidth- Available pixels, where rendering anything wider than this amount of pixels may overlap with other GUI elements or go out of boundscolor- Desired color of text, serving as a hint of best color to use for it to be distinct from background- Returns:
trueto prevent default rendering,falseotherwise
-
extractHudIcon
default boolean extractHudIcon(MobEffectInstance instance, Hud hud, GuiGraphicsExtractor graphics, int x, int y, int width, int height, int color) 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 instancehud- The HUDgraphics- The gui graphicsx- The x coordinatey- The y coordinatewidth- Available width of canvas to render inheight- Available height of canvas to render incolor- Color multiplicator of the icon- Returns:
trueto prevent default rendering,falseotherwise
-