Skip to content

General Types

Ingredient

An ingredient is a predicate of ItemStack.

Shorthand Format

Checks if item id matches:

<item_id>

Checks if item has the tag:

#<item_tag>

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 NeoForge'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

SizedIngredient

A SizedIngredient is an ingredient with a count.

Shorthand Format

Checks if item id matches:

<item_id>(single item) or <count>x <item_id>(multiple items)

Checks if item has the tag:

#<item_tag>(single item) or <count>x #<item_tag>(multiple items)

Format

Checks if item id matches:

Name Description Type / Literal
item item resource id string
count item count optional int

Checks if item has the tag:

Name Description Type / Literal
tag the item tag string
count item count optional int

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
count item count optional int
additional properties...

You can use NeoForge'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
count item count optional int
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.

Shorthand Format

Matches all blocks:

*

Checks if block id matches:

<block_id> or <block_id>[<property>=<value>, ...] or <block_id>{<nbt>}

Checks if block has the tag:

#<block_tag> or #<block_tag>[<property>=<value>, ...] or #<block_tag>{<nbt>}

Format

A BlockPredicate can be either a simple string or a dictionary:

Name Description Type / Literal
blocks one or more block(s) (an ID, or a tag with #, or an array containing IDs). optional string | string[]
nbt the block nbt optional string
state a map of block property names to values optional StatePropertiesPredicate
Example
minecraft:oak_log[axis=y]
"minecraft:oak_log[axis=y]"
'#wooden_stairs'
"#wooden_stairs"
blocks: tconstruct:seared_lantern
nbt: '{"tank":{"FluidName":"thermal:tree_oil","Amount":50}}'
{
    "blocks": "tconstruct:seared_lantern",
    "nbt": "{\"tank\":{\"FluidName\":\"thermal:tree_oil\",\"Amount\":50}}"
}

StatePropertiesPredicate

A BlockPredicate is a predicate of StateDefinition.

Format

Name Description Type / Literal
key block property key and value pair string
key block property key with ranged number dictionary
- min minimum value string
- max maximum value string
Example

Matches water source block:

blocks: water
state:
  level: '0'
{
    "blocks": "water",
    "state": {
        "level": "0"
    }
}

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].

ItemStack

An ItemStack is an item with its count and components.

Shorthand Format

<item_id>(single item) or <count>x <item_id>(multiple items)

Example
3x diamond
"3x diamond"
item: diamond
count: 3
components:
  item_name: ComponentTest
{
    "item": "diamond",
    "count": 3,
    "components": {
        "item_name": "ComponentTest"
    }
}

or in shorthand form:

item: diamond[item_name=ComponentTest]
count: 3
{
"item": "diamond[item_name=ComponentTest]",
"count": 3
}

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 /.

Example

/path/to/the/target
"/path/to/the/target"