Requirements
Requirements are a list of checks that must succeed for an Action Item to execute it’s actions.
Creating Requirements
Section titled “Creating Requirements”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}Requirements Options
Section titled “Requirements Options”Requirements (required)
Section titled “Requirements (required)”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": []}Type (required)
Section titled “Type (required)”The type of requirement that this entry is. A list of types can be found in Requirement Types.
"type": "PERMISSION"Comparison
Section titled “Comparison”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
Section titled “Additional Options”Additional options are available depending on the type of requirement used. See Requirement Types for each type’s additional options.
Success Actions
Section titled “Success Actions”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": []}Deny Actions
Section titled “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!"] } ]}Minimum Requirements
Section titled “Minimum Requirements”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}Stop At Success
Section titled “Stop At Success”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}Requirement Types
Section titled “Requirement Types”These are the available Requirement Types and their respective settings. Some settings are optional, while others may be required.
| Identifier | Description | Required Mods |
|---|---|---|
| PERMISSION | Check if the player has a permission | |
| ITEM | Check if the player has an item. Strict will define if NBT needs to be exact | |
| CURRENCY | Check if the player has an amount of currency | |
| DIMENSION | Check if the player is in a dimension | |
| PLACEHOLDER | An input string will be parsed and checked against an output string. Strict will define if capitalization needs to be exact | |
| XP | Check if the player has a specific amount of XP. Level will define if checking levels instead of total XP | |
| ADVANCEMENT | Check a players progress on a specific advancement | |
| MOLANG | Check a Molang expression against a value | Cobblemon |
Permission Requirement
Section titled “Permission Requirement”Check if the player has a specific permission node. Supports == and != comparisons.
"type": "PERMISSION","comparison": "==","permission": "example.permission"Item Requirement
Section titled “Item Requirement”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 trueCurrency Requirement
Section titled “Currency Requirement”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": 100Dimension Requirement
Section titled “Dimension Requirement”Check if the player is currently in a specific dimension. Supports == and != comparisons.
"type": "DIMENSION","comparison": "==","id": "minecraft:overworld"Placeholder Requirement
Section titled “Placeholder Requirement”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 falseXP Requirement
Section titled “XP Requirement”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 pointsAdvancement Requirement
Section titled “Advancement Requirement”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.0Cobblemon Molang Requirement
Section titled “Cobblemon Molang Requirement”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 trueComparison Types
Section titled “Comparison Types”| Identifier | Supported Requirements |
|---|---|
| == | ALL |
| != | ALL |
| > | ITEM, CURRENCY, XP, ADVANCEMENT |
| < | ITEM, CURRENCY, XP, ADVANCEMENT |
| >= | ITEM, CURRENCY, XP, ADVANCEMENT |
| <= | ITEM, CURRENCY, XP, ADVANCEMENT |
Example Uses
Section titled “Example Uses”Below are examples of how to use requirements in different contexts.
Click Requirements
Section titled “Click Requirements”Requirements that must be met in order to execute an item’s click actions.
{ "display": {}, "requirements": { "requirements": [] // Additional options if desired... }}Action Requirements
Section titled “Action Requirements”Requirements for a specific action to run.
{ "display": {}, "actions": [ { "type": "MESSAGE", "message": "test message", "requirements": { "requirements": [] // Additional options if desired... } } ]}