Wiki 9Minecraft Wiki 9Minecraft
Data Tip Wiki › Guides › Add Conditional Tooltip Lines Based on Game State

Add Conditional Tooltip Lines Based on Game State

Use Conditions to Show Context-Specific Text

Display different tooltip content depending on where you are or what's happening:

`json

{

"match": "minecraft:golden_apple",

"lines": [

{

"text": "Golden Apple"

},

{

"text": "Restores health in Nether",

"condition": {

"type": "dimension",

"value": "minecraft:the_nether"

}

},

{

"text": "Less effective here",

"condition": {

"type": "biome",

"value": "minecraft:desert"

}

}

]

}

`

Available Conditions

Common condition types include dimension, biome, weather, player hunger level, and NBT data matching. Lines only appear when their condition is true.

Test in Different Locations

Reload your resource pack. Travel to different dimensions and biomes, then hover over the item to see the conditional text appear and disappear based on your current game state.