General Types¶
Ingredient¶
An ingredient is a predicate of ItemStack.
Format
Checks if item id matches:
Name | Description | Type / Literal |
---|---|---|
item | item resource id | string |
Checks if item has the tag:
Name | Description | Type / Literal |
---|---|---|
tag | the item tag | string |
If you want to specify a modded item or tag, you need to write down the namespace at start, for example "namespace:name"
Custom Ingredients¶
Custom ingredient created by modders:
Name | Description | Type / Literal |
---|---|---|
type | ingredient type | string |
additional properties... |
You can use Forge's built-in features to check item nbt or combine several ingredients to one compound ingredient: Documentation
Name | Description | Type / Literal |
---|---|---|
fabric:type | ingredient type | string |
additional properties... |
You can use Fabric's built-in features to check item nbt or combine several ingredients to one compound ingredient: Documentation
BlockPredicate¶
A BlockPredicate is a predicate of an in-world block. It can also be used to represent the first possible block that matches this predicate.
Format
Name | Description | Type / Literal |
---|---|---|
blocks | block resource ids optional | string[] |
tag | the block tag optional | string |
nbt | the block nbt optional | string |
state | a map of block property names to values optional | StatePropertiesPredicate |
As a shortcut you can use a string to represent a simple BlockPredicate.
Example
{
"blocks": ["tconstruct:seared_lantern"],
"nbt": "{\"tank\":{\"FluidName\":\"thermal:tree_oil\",\"Amount\":50}}"
}
Special case¶
You can use "*"
to represent a BlockPredicate to match all blocks.
StatePropertiesPredicate¶
A BlockPredicate is a predicate of StateDefinition.
Format
Name | Description | Type / Literal |
---|---|---|
key | block property key and value pair | string | boolean | int |
key | block property key with ranged number | object |
- min | minimum value | int |
- max | maximum value | int |
Example
Matches water source block:
{
"blocks": ["water"],
"state": {
"level": 0
}
}
LocationPredicate¶
Predicate applied to location. Please refer to the Minecraft Wiki.
IntBounds¶
Describes a inclusive range for integers.
Format
Name | Description | Type / Literal |
---|---|---|
min | minimum value optional | int |
max | maximum value optional | int |
IntBounds can also be a simple int
to represent [n, n].
DoubleBounds¶
Describes a inclusive range for doubles.
Format
Name | Description | Type / Literal |
---|---|---|
min | minimum value optional | number |
max | maximum value optional | number |
DoubleBounds can also be a simple number
to represent [n, n].
JsonPointer¶
JsonPointer is a string syntax for identifying a specific value within a JSON. But the only thing you need to know is you should separate the path to the target with /
.
"/path/to/the/target"