Skip to content

Tooltip

Power Type

Applies the specified tooltip text(s) to an item that is only visible to the entity that has the power.

Type ID: eggolib:tooltip

Note

This power type allows for usage of JSON text components that require "resolving". See Minecraft Fandom Wiki: Raw JSON text format (Component resolution) for more information.

Fields

Field Type Default Description
item_condition Item Condition Type optional If specified, the specified tooltip text(s) will only apply to items that fulfill this condition.
text Text Component optional If specified, this tooltip text will be applied to the item.
texts Array of Text Components optional If specified, these tooltip texts will be applied to the item.
tick_rate Positive Integer 20 Determines how frequent the specified tooltip text(s) are resolved.
order Integer 0 Determines the placement order of the tooltip text(s) of the power.

Examples

{
    "type": "eggolib:tooltip",
    "item_condition": {
        "type": "apoli:ingredient",
        "ingredient": {
            "item": "minecraft:diamond"
        }
    },
    "text": {
        "text": "Ooh, shiny!",
        "color": "yellow"
    }
}

This example will apply a yellow-colored "Ooh, shiny!" tooltip text to Diamond items.

{
    "type": "eggolib:tooltip",
    "item_condition": {
        "type": "apoli:ingredient",
        "ingredient": {
            "tag": "example:melee_weapons"
        }
    },
    "text": [
        "",
        {
            "text": "Kills: ",
            "color": "gray",
            "italic": false
        },
        {
            "score": {
                "name": "@s",
                "objective": "melee_kills"
            },
            "color": "red",
            "bold": true
        }
    ]
}

This example will apply a gray-colored "Kills: <number>" tooltip text to items that are included in the #example:melee_weapons (data/example/tags/items/melee_weapons.json) item tag.

With <number> being the score of the entity that has the power from the melee_kills scoreboard objective colored red and bold.