Conditions¶
Conditions restrict dialogues, buttons, actions and shop offers. A list uses AND: every entry must pass. negate: true reverses a valid condition's result.
[
{"type": "tag", "value": "village_visitor"},
{"type": "item", "value": "greatnpc:coin_gold", "amount": 2},
{"type": "gamemode", "value": "spectator", "negate": true}
]
This list requires the visitor tag, at least two gold coins and a non-spectator player. Checking an item condition does not charge the item. Use trade costs for payment.
type |
value |
amount / behavior |
|---|---|---|
tag |
Player command tag | Player must have it. |
permission |
Permission node | Permission must be granted. |
item |
Item ID | Minimum inventory quantity; at least one. |
hand_item |
Item ID | Must be in the main hand. |
level |
Unused | Minimum Minecraft experience level. |
health |
Unused | Minimum health points; two points equal one heart. |
time |
day or night |
Checks world time. |
weather |
clear, rain or thunder |
Checks world weather. |
gamemode |
survival, creative, adventure or spectator |
Exact game mode. |
defeated |
Trainer ID; blank means this NPC's trainer | Minimum recorded victories; at least one. |
pokemon |
Species ID, such as pikachu |
Species must occur in the player's party. |
party_size |
Unused | Minimum number of Pokémon in the party. |
party_level |
Unused | At least one party Pokémon must reach this level. |
party_level does not require every party member to reach the threshold. pokemon checks species rather than an exact move set, form, held item or IV configuration. For battle-entry restrictions, also review the trainer's party requirement settings.
Time uses the current world's day cycle: day is below tick 13000 and night is the remainder. Rain can also be true during a thunderstorm. Use the listed values rather than relying on fallbacks for invalid weather/time strings.
Unknown condition types and evaluation errors fail closed, including when the condition is negated. A blank condition list imposes no restriction.
Item IDs without a namespace are searched in minecraft and then cobblemon; use explicit namespaced IDs for predictable modded-item behavior.