Repository navigation
Condition Providers
Guided offers condition providers that allow you to control the visibility of entries and pages based on player progression. All conditions are evaluated on the client.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
type |
string |
Yes | — | ID of condition provider |
conditions |
json array |
For guided:and and guided:or
|
— | List of conditions to check |
condition |
json object |
For guided:not
|
— | Condition to invert |
advancement |
string |
For guided:advancement
|
— | ID of advancement |
item |
string |
For guided:item
|
— | ID of item that player must have picked up |
statistic_type |
string |
For guided:stat
|
— | ID of statistic type |
statistic |
string |
For guided:stat
|
— | ID of statistic to check |
comparison |
string |
For guided:stat
|
— | Comparison operator |
value |
integer |
For guided:stat
|
— | Value to compare statistic against |
Guided offers 8 built-in condition providers:
-
guided:true- Always passes -
guided:false- Always fails -
guided:and- All conditions must pass -
guided:or- At least one condition must pass -
guided:not- Specified condition must fail -
guided:advancement- Player must have completed an advancement -
guided:item- Player must have picked up an item at least once -
guided:stat- Player statistic must satisfy a comparison
To add a condition to your entry use the condition parameter. If the condition fails, the entry will not be displayed. If no condition is specified, the entry is visible by default.
Example entry definition:
{
"name": "Diamonds",
"category": "default",
"condition": {
"type": "guided:advancement",
"advancement": "minecraft:story/mine_diamond"
},
"pages": [
{
"type": "guided:text",
"definition": {
"text": "You have discovered diamonds!"
}
}
]
}To add a condition to an individual page, place it inside the page's definition object.
Example page definition:
{
"type": "guided:text",
"definition": {
"text": "You have discovered diamonds!",
"condition": {
"type": "guided:advancement",
"advancement": "minecraft:story/mine_diamond"
}
}
}By default, pages with failed conditions are hidden. To display an alternative page instead see Page Providers.
These providers always return the same result. They do not require any additional parameters and can be useful for testing your guidebook.
Example condition that always passes:
{
"type": "guided:true"
}Example condition that always fails:
{
"type": "guided:false"
}The guided:and provider allows you to combine multiple conditions. All conditions must pass.
Example definition:
{
"type": "guided:and",
"conditions": [
{
"type": "guided:item",
"item": "minecraft:diamond"
},
{
"type": "guided:item",
"item": "minecraft:emerald"
}
]
}This condition passes if the player has picked up both a diamond and an emerald at least once.
The guided:or provider allows you to specify multiple conditions. At least one of these conditions must pass.
Example definition:
{
"type": "guided:or",
"conditions": [
{
"type": "guided:item",
"item": "minecraft:diamond"
},
{
"type": "guided:item",
"item": "minecraft:emerald"
}
]
}This condition passes if the player has picked up either item or both items. Empty conditions arrays fail for both AND and OR.
The guided:not provider inverts the result of another condition.
Example definition:
{
"type": "guided:not",
"condition": {
"type": "guided:advancement",
"advancement": "minecraft:story/mine_diamond"
}
}This condition passes if the player has not completed the specified advancement.
The guided:advancement provider checks if the player has completed a specified advancement.
Example definition:
{
"type": "guided:advancement",
"advancement": "minecraft:story/mine_diamond"
}Partially completed advancements do not satisfy this condition.
The guided:item provider checks if the player has picked up a specified item at least once using Minecraft's item pickup statistic.
Example definition:
{
"type": "guided:item",
"item": "minecraft:diamond"
}Note
This provider does not check the player's current inventory. The condition can still pass after the player loses the item. Receiving an item through crafting or a command does not necessarily increase its pickup statistic.
The guided:stat provider compares a Minecraft statistic against a specified value.
Available comparisons:
-
>- Greater than -
>=- Greater than or equal to -
<- Less than -
<=- Less than or equal to -
==- Equal to -
!=- Not equal to
Example definition:
{
"type": "guided:stat",
"statistic_type": "minecraft:mined",
"statistic": "minecraft:stone",
"comparison": ">=",
"value": 10
}This condition passes if the player has mined at least 10 stone blocks.
Some available statistic types:
| Statistic type | Example statistic | Description |
|---|---|---|
minecraft:mined |
minecraft:stone |
Blocks mined |
minecraft:crafted |
minecraft:crafting_table |
Items crafted |
minecraft:used |
minecraft:iron_pickaxe |
Items used |
minecraft:broken |
minecraft:iron_pickaxe |
Items broken |
minecraft:picked_up |
minecraft:diamond |
Items picked up |
minecraft:dropped |
minecraft:diamond |
Items dropped |
minecraft:killed |
minecraft:zombie |
Entities killed |
minecraft:killed_by |
minecraft:zombie |
Deaths caused by entity type |
minecraft:custom |
minecraft:play_time |
Custom statistics |
Statistic values use Minecraft's raw units. For example, minecraft:play_time is measured in ticks, not seconds.
You can nest condition providers inside each other to create more complex progression requirements.
Example definition:
{
"type": "guided:and",
"conditions": [
{
"type": "guided:advancement",
"advancement": "minecraft:story/mine_diamond"
},
{
"type": "guided:or",
"conditions": [
{
"type": "guided:item",
"item": "minecraft:emerald"
},
{
"type": "guided:stat",
"statistic_type": "minecraft:mined",
"statistic": "minecraft:stone",
"comparison": ">=",
"value": 100
}
]
}
]
}This condition passes if the player has completed the Diamonds! advancement and has either picked up an emerald or mined at least 100 stone blocks.
Item and statistic providers use the statistics available on the client. If your statistics are not up to date, open Minecraft's Statistics screen and reload the guidebook conditions using the reload key (R by default).
Conditions only control guidebook visibility. They do not prevent players from performing actions on the server. Entry connections do not automatically create conditions.
Developers can register their own condition providers using Guided's Java API. For more information see Addon Development.