Requirements
Requirements are conditional guards used wherever the AstralCore configuration layer needs to gate something on player state — most commonly item visibility (view-requirements) and click permission (clicks-requirements) in menus, button gating in dialogs, and the open/use checks in collections. By default all requirements in a list must pass for the action to proceed; the min-requirements field can relax this to "N of M must pass".
A requirement can be written in two forms.
Inline (shorthand)
Object form (with deny-actions)
deny-actions is a list of Actions executed on the player when this requirement fails.
min-requirements (object form)
When you want "any N of these must pass" instead of "all", wrap the list in an object:
Built-in Requirements
permission
Checks whether the player has a given permission node. Prefix with ! to negate.
Parameter | Description |
|---|---|
value | Permission node string. Prefix |
compare
Compares two values using a relational operator. Both operands support placeholder substitution and are coerced to numbers when possible; otherwise a lexicographic string comparison is used.
Supported operators: ==, !=, >, <, >=, <=
regex
Tests whether a value matches a Java regular expression. Format: <value> <pattern>.
string-length
Checks the character length of a string. Format: <string> <operator> <int>.
Supported operators: ==, !=, >, <, >=, <=
world
Checks the world the player is currently in. Format: <operator> <world-name>.
Supported operators: ==, !=
has-item
Checks whether the executing player carries a given item. The value is resolved to an ItemStack, then matched against the player's inventory: stacks are compared by similarity (material, item meta, enchantment storage, damage/max-damage and persistent data — the stack size is ignored), and the amounts of all matching stacks are summed until the resolved item's own amount is covered. The whole inventory contents are scanned, armor and offhand included.
Parameter | Description |
|---|---|
value | An |
Requirement Summary Table
ID | Value format | Description |
|---|---|---|
|
| Check (negated) permission |
|
| Numeric or string comparison |
|
| Regex match |
|
| String length comparison |
|
| Player current world check |
|
| Player inventory contains a similar item |