# Requirement display info

A requirement display info is a small icon that show up in jei recipe jei to provide the player various information about the recipe.

The display info can use any item, texture or sprite and have a list of tooltips that will be displayed when the player hover it with its mouse cursor.

Example : The [Structure requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) add by default a structure block icon with a tooltip indicating the list of required blocks to build the structure.

![](https://content.gitbook.com/content/ZznnGu8KvEhqjN3qmLqp/blobs/nNOenj5skmta9ocyfwJa/image.png)

You can override the default display info of any requirements, or create a new one for requirements that doesn't have a default one.

A custom display info won't override the click behavior of a default display info, like the structure requirement that let you click on the icon to show the structure.

{% hint style="warning" %}
Each requirements can have only 1 display info.
{% endhint %}

### Tooltip

A display info can have a list of tooltips specified. If the requirement have a default tooltip it will be overriden.

The tooltip is essentially a list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component). Each component in the list will be a new line in the tooltip.

```json
"info": {
    "tooltips": [
        "Some tooltips",
        {"text": "Some tooltip in red", "color": "red"}
    ]
}
```

### Icon

There are 3 ways to define a display info icon : item, texture and sprite (animated texture).

If you don't specify an icon this default green + icon will be used.

![](https://content.gitbook.com/content/ZznnGu8KvEhqjN3qmLqp/blobs/GXAOvACIulUqdH9hdb5Z/image.png)

#### Item

Simply provide the id of the item to show as icon.

Example : Show a diamond as icon

```json
"info": {
    "item": "minecraft:diamond"
}
```

#### Texture

Simply provide the path to the texture file, the texture MUST be in a loaded resourcepack (Openloader or KubeJS work well for that) and the .png extension is necessary.

You can also specify the width/height of the texture (default 10px) and the u/v of the texture (default 0).

Example :&#x20;

```json
"info": {
    "icon": "custommachinery:textures/gui/creation/create_icon.png"
}
```

#### Sprite

A sprite is essentialy a texture that is stitched into a Minecraft texture atlas, allowing the use of animated textures.

Simply specify the id of the atlas and the id of the texture.

Example : Use the purple nether portal block

```json
"info": {
    "atlas": "minecraft:textures/atlas/blocks.png",
    "sprite": "minecraft:block/nether_portal"
}
```

### Example

Add a diamond icon with a tooltip :&#x20;

```json
{
    //other requirement properties
    "info": {
        "item": "minecraft:diamond",
        "tooltips": ["This recipe make diamonds"]
    }
}
```

![](https://content.gitbook.com/content/ZznnGu8KvEhqjN3qmLqp/blobs/cyhZBi1Zm0lVb7Fey6TD/image.png)
