List of the available requirements:
Requirements are used in view-requirements, open-requirements, the different click requirements and in conditional-lore conditions. When you list more than one, every one of them has to be met.
Put a ! in front of any requirement to invert it. For example this item is only visible to players who don't have the permission:
view-requirements:
- "![permission] example.permission"
Check if the player has the permission.
[permission] example.permission
Check whether the player has enough money or not. The economy provider name and the currency can be omitted. To use a currency you must also specify the provider. See Economy providers for the provider names and which ones support currencies.
[money] 1000
[money] 1000 Vault
[money] 1000 CoinsEngine gems
Check if the player has the required vanilla exp level.
[exp-level] 10
Check if the player has the required items in his inventory. This only supports custom items, defined in Item configand basic vanilla item ids (minecraft:coal for example). List your items separated by spaces and add /number at the end to specify how many of that item the player should have in his inventory.
[has-items] oraxen:some_item/32 mythicmobs:super_sword/1
Check placeholder comparisons. Requires PlaceholderAPI. == compares the values as text, while ===, >=, <=, > and < compare them as numbers. The right side can contain placeholders as well.
[placeholder] %some_placeholder% == some value
[placeholder] %some_number_placeholder% === some number value
[placeholder] %some_number_placeholder% >= 10
[placeholder] %some_number_placeholder% <= 10
[placeholder] %some_number_placeholder% > 10
[placeholder] %some_number_placeholder% < 10
Check menu argument comparisons. Uses the same comparison operators as the placeholder requirement.
[arg] some_arg == some value
[arg] some_number_arg === some number value
[arg] some_number_arg >= 10
[arg] some_number_arg <= 10
[arg] some_number_arg > 10
[arg] some_number_arg < 10
Check the player's meta values (see Commands and the meta actions in Command dispatcher). Uses the same comparison operators as the placeholder requirement. If a meta value doesn't exist, it counts as an empty text or 0.
[meta] some_meta_key == some value
[meta] some_number_meta_key === some number value
[meta] some_number_meta_key >= 10
[meta] some_number_meta_key <= 10
[meta] some_number_meta_key > 10
[meta] some_number_meta_key < 10
You can register your own requirements to use it everywhere in the menus.
Prefix can't contain spaces! First arg will always be the prefix.
AuroraAPI.registerRequirementHandler("my-requirement", (player, args) -> {
// You need to return a boolean here. args is a String array,
// args[0] is the prefix itself, eg: "[my-requirement]"
return args.length > 2;
});
Then you can use it in your menus like:
view-requirements:
- "[my-requirement] arg1 arg2 arg3"