Shared Constructs
JSON constructs are expressible in multiple locations in the add-ons system.
Block Descriptors
Block descriptors can be used to check for blocks that match the specified properties. For example, block descriptors are used in the block placement filter to determine which types of blocks a custom block can survive on.
{
"name": "wiki:my_block"
}
{
"name": "wiki:my_block",
"states": {
"wiki:my_state": 5
}
}
{
"tags": "q.any_tag('minecraft:is_axe_item_destructible', 'wiki:my_tag')"
}
Range Objects
Range objects define a spread between two numbers.
{
"min": 2,
"max": 4
}
When provided, a random value will be selected inclusively between the minimum and maximum. Rolls are not retained; a new random value will be rolled each instance the range object would be used. The maximum must not be less than the minimum, but they may be equal to affix rolls to a specific value.
Fraction Objects
Fraction objects define a fraction using a numerator and denominator.
{
"numerator": 3,
"denominator": 5
}
The value used in place of the object will be the computed division, numerator
÷ denominator
. Both the numerator and denominator must be at least 1
, and the denominator cannot be equal to the numerator.