Interface IEntityComponentProvider
Entity tooltip information to Waila.
All methods in this interface shouldn't to be called by the implementing mod.
An instance of the class is to be registered via the IClientRegistrar instance provided in IWailaClientPlugin.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EntityAn "empty" entity to be used withgetOverride(mcp.mobius.waila.api.IEntityAccessor, mcp.mobius.waila.api.IPluginConfig), effectively disabling the tooltip to be displayed. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidappendBody(ITooltip tooltip, IEntityAccessor accessor, IPluginConfig config) Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).default voidappendDataContext(IDataWriter ctx, IEntityAccessor accessor, IPluginConfig config) Callback used to send additional context toIDataProviders.default voidappendHead(ITooltip tooltip, IEntityAccessor accessor, IPluginConfig config) Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).default voidappendTail(ITooltip tooltip, IEntityAccessor accessor, IPluginConfig config) Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).default @Nullable ITooltipComponentgetIcon(IEntityAccessor accessor, IPluginConfig config) Callback used to set an icon to display in the tooltip.getOverride(IEntityAccessor accessor, IPluginConfig config) Callback used to override the default Waila lookup system.default ITargetRedirector.Resultredirect(ITargetRedirector redirect, IEntityAccessor accessor, IPluginConfig config) Redirect the ray cast hit result to target other object.
-
Field Details
-
EMPTY_ENTITY
An "empty" entity to be used withgetOverride(mcp.mobius.waila.api.IEntityAccessor, mcp.mobius.waila.api.IPluginConfig), effectively disabling the tooltip to be displayed.Note: Waila will use
==instead ofObject.equals(java.lang.Object)to check for this.
-
-
Method Details
-
redirect
@Nullable @Experimental default ITargetRedirector.Result redirect(ITargetRedirector redirect, IEntityAccessor accessor, IPluginConfig config) Redirect the ray cast hit result to target other object.- Parameters:
redirect- the redirectoraccessor- contains most of the relevant information about the current environment. Note thatIEntityAccessor.getData()will always be empty at this timeconfig- current plugin configuration- Returns:
nullif this method doesn't redirect to anything, any result from one ofITargetRedirector's methods otherwise- See Also:
-
appendDataContext
Callback used to send additional context toIDataProviders.- Parameters:
ctx- the context writeraccessor- contains most of the relevant information about the current environment. Note thatIEntityAccessor.getData()will always be empty at this timeconfig- current plugin configuration- See Also:
-
getOverride
Callback used to override the default Waila lookup system.- Parameters:
accessor- contains most of the relevant information about the current environmentconfig- current plugin configuration- Returns:
nullif override is not required, anEntityotherwise- See Also:
-
getIcon
@Nullable default @Nullable ITooltipComponent getIcon(IEntityAccessor accessor, IPluginConfig config) Callback used to set an icon to display in the tooltip.This method is only called on the client side. If you require data from the server, you should also implement
IDataProviderand add the data there, which can then be read back usingIEntityAccessor.getData(). If you rely on the client knowing the data you need, you are not guaranteed to have the proper values.- Parameters:
accessor- contains most of the relevant information about the current environmentconfig- current plugin configuration- Returns:
- the component to render or
nullif this provider doesn't decide it - See Also:
-
appendHead
Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).This method is only called on the client side. If you require data from the server, you should also implement
IDataProviderand add the data there, which can then be read back usingIEntityAccessor.getData(). If you rely on the client knowing the data you need, you are not guaranteed to have the proper values.- Parameters:
tooltip- current list of tooltip lines (might have been processed by other providers and might be processed by other providers), useITooltip.setLine(net.minecraft.resources.ResourceLocation)with tags fromWailaConstantsto override built-in valuesaccessor- contains most of the relevant information about the current environmentconfig- current plugin configuration- See Also:
-
appendBody
Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).This method is only called on the client side. If you require data from the server, you should also implement
IDataProviderand add the data there, which can then be read back usingIEntityAccessor.getData(). If you rely on the client knowing the data you need, you are not guaranteed to have the proper values.- Parameters:
tooltip- current list of tooltip lines (might have been processed by other providers and might be processed by other providers), useITooltip.setLine(net.minecraft.resources.ResourceLocation)with tags fromWailaConstantsto override built-in valuesaccessor- contains most of the relevant information about the current environmentconfig- current plugin configuration- See Also:
-
appendTail
Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).This method is only called on the client side. If you require data from the server, you should also implement
IDataProviderand add the data there, which can then be read back usingIEntityAccessor.getData(). If you rely on the client knowing the data you need, you are not guaranteed to have the proper values.- Parameters:
tooltip- current list of tooltip lines (might have been processed by other providers and might be processed by other providers), useITooltip.setLine(net.minecraft.resources.ResourceLocation)with tags fromWailaConstantsto override built-in valuesaccessor- contains most of the relevant information about the current environmentconfig- current plugin configuration- See Also:
-