Skip to content

Requirements

Requirements are a list of checks that must succeed for an Action Item to execute it’s actions.


Requirements sections follow the below format. To understand what use cases are available, see Example Uses.

"requirements": {
"requirements": [], // A list of actual requirements
"success_actions": [], // Optional - A list of actions to run when requirements succeed
"deny_actions": [], // Optional - A list of actions to run when requirements fail
"minimum_requirements": 1, // Optional - Minimum number of requirements that must succeed
"stop_at_success": false // Optional - Stop checking requirements after the minimum successful requirements are met
}

A MAP of requirements that need to be checked. Each entry needs its unique string identifier. In this example below. It has two requirements defined within the "requirements": {} section: requirement_1 and requirement_2.

"requirements": {
"requirements": [
{
"type": "PERMISSION",
"permission": "example.permission"
},
{
"type": "CURRENCY",
"economy": "IMPACTOR",
"amount": 100,
"currency": "impactor:dollars"
}
],
"success_actions": [],
"deny_actions": []
}

The type of requirement that this entry is. A list of types can be found in Requirement Types.

"type": "PERMISSION"

The type of comparison that this requirement should do. The usage changes depending on the requirement used. See Comparison Types for more information.

"comparison": "=="

Additional options are available depending on the type of requirement used. See Requirement Types for each type’s additional options.


A list of actions that are performed when all requirements has succeeded. Each entry needs its unique string identifier. See Actions for more information.

"requirement": {
"requirements": [],
"success_actions": [
{
"type": "MESSAGE",
"message": ["<red>You do have permission!"]
}
],
"deny_actions": []
}

A list of actions that are performed when any requirement has failed. Each entry needs its unique string identifier. See Actions for more information.

"requirement": {
"requirements": [],
"success_actions": [],
"deny_actions": [
{
"type": "MESSAGE",
"message": ["<red>You do not have permission!"]
}
]
}

The minimum number of requirements that must succeed in order for the overall requirements to be considered successful.

"<type_>requirement": {
"requirements": [],
"success_actions": [],
"deny_actions": [],
"minimum_requirements": 1
}

A boolean value that defines whether to stop checking requirements after the minimum successful requirements are met. Defaults to false if not provided.

"<type_>requirement": {
"requirements": [],
"success_actions": [],
"deny_actions": [],
"stop_at_success": true
}

These are the available Requirement Types and their respective settings. Some settings are optional, while others may be required.

IdentifierDescriptionRequired Mods
PERMISSIONCheck if the player has a permission
ITEMCheck if the player has an item. Strict will define if NBT needs to be exact
CURRENCYCheck if the player has an amount of currency
DIMENSIONCheck if the player is in a dimension
PLACEHOLDERAn input string will be parsed and checked against an output string. Strict will define if capitalization needs to be exact
XPCheck if the player has a specific amount of XP. Level will define if checking levels instead of total XP
ADVANCEMENTCheck a players progress on a specific advancement
MOLANGCheck a Molang expression against a valueCobblemon

Check if the player has a specific permission node. Supports == and != comparisons.

"type": "PERMISSION",
"comparison": "==",
"permission": "example.permission"

Check if the player has a specific item in their inventory. Supports all comparison types.

"type": "ITEM",
"comparison": ">=",
"item": "minecraft:diamond",
"amount": 5, // Optional
"components": {}, // Optional
"custom_model_data": 1, // Optional
"strict": true // Optional, defaults to true

Check if the player has a specific amount of currency in their account. Supports all comparison types.

"type": "CURRENCY",
"comparison": ">=",
"economy": "IMPACTOR",
"currency": "impactor:dollars", // Optional
"amount": 100

Check if the player is currently in a specific dimension. Supports == and != comparisons.

"type": "DIMENSION",
"comparison": "==",
"id": "minecraft:overworld"

An input string will be parsed by all available Placeholder Services and checked against an output. Supports == and != comparisons.

"type": "PLACEHOLDER",
"comparison": "==",
"input": "%player_health%",
"output": "20",
"strict": false // Optional, defaults to false

Check if the player has a specific amount of XP. Supports all comparison types.

"type": "XP",
"comparison": ">=",
"amount": 500,
"level": true // Optional, defaults to false. True to give levels, false to give points

Check a players progress on a specific advancement. Supports all comparison types.

"type": "ADVANCEMENT",
"comparison": ">=",
"advancement": "minecraft:husbandry/bred_all_animal",
"progress": 1.0 // Optional, defaults to 1.0

Check a Molang expression against a value. Requires the Cobblemon mod. Supports all comparison types.

"type": "MOLANG",
"equals": "==",
"script": ["t.party = q.gui.player.party; t.pokemon = t.party.get_pokemon(0); t.pokemon.is_shiny;"],
"output": ["1"]
"strict": false // Optional, defaults to false. Ignores case sensitivity when true

IdentifierSupported Requirements
==ALL
!=ALL
>ITEM, CURRENCY, XP, ADVANCEMENT
<ITEM, CURRENCY, XP, ADVANCEMENT
>=ITEM, CURRENCY, XP, ADVANCEMENT
<=ITEM, CURRENCY, XP, ADVANCEMENT

Below are examples of how to use requirements in different contexts.

Requirements that must be met in order to execute an item’s click actions.

{
"display": {},
"requirements": {
"requirements": []
// Additional options if desired...
}
}

Requirements for a specific action to run.

{
"display": {},
"actions": [
{
"type": "MESSAGE",
"message": "test message",
"requirements": {
"requirements": []
// Additional options if desired...
}
}
]
}