Skip to content

Requirements

Requirements are a list of checks that must succeed to buy/sell a shop entry, depending on where its defined.


All requirement sections follow the below format.

"requirements": {
"requirements": {}, // A MAP of actual requirements
"success_actions": {}, // Optional - A MAP of actions to run when requirements succeed
"deny_actions": {}, // Optional - A MAP 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
"send_denial_message": true // Optional - Whether to send a default denial message when requirements fail. Defaults to true if not provided
}

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": {
"requirement_1": {
"type": "PERMISSION",
"permission": "example.permission"
},
"requirement_2": {
"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 MAP of actions that are performed when all requirements has succeeded. Each entry needs its unique string identifier. See Actions for more information.

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

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

"requirements": {
"requirements": {},
"success_actions": {},
"deny_actions": {
"deny_action_1": {
"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.

"requirements": {
"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.

"requirements": {
"requirements": {},
"success_actions": {},
"deny_actions": {},
"stop_at_success": true
}

A boolean value that defines whether to send a default denial message when requirements fail. Defaults to true if not provided.

"requirements": {
"requirements": {},
"success_actions": {},
"deny_actions": {},
"send_denial_message": false
}

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
PLAN_PLAYTIMECheck the player’s playtime.Plan

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 the player’s playtime. Requires the Plan mod. Supports all comparison types.

"type": "PLAN_PLAYTIME",
"comparison": ">=",
"time": 3600 // Time in seconds
IdentifierSupported Requirements
==ALL
!=ALL
>ITEM, CURRENCY, XP, ADVANCEMENT, PLAN_PLAYTIME
<ITEM, CURRENCY, XP, ADVANCEMENT, PLAN_PLAYTIME
>=ITEM, CURRENCY, XP, ADVANCEMENT, PLAN_PLAYTIME
<=ITEM, CURRENCY, XP, ADVANCEMENT, PLAN_PLAYTIME