Components Requirement

This is essentially the 1.21+ version of an NBT requirement, which checks an item's data components.

Note:

As of version 2.4, components requirements have been rewritten to behave like NBT requirements, meaning they implement custom NBT features such as "cs:any_of" and numerical ranges.

On earlier versions, component data will be strictly matched against the target. Furthermore, components requirements must follow valid component syntax, meaning no fields in the component's structure may be omitted.

Example:

{
  "components": {
    "minecraft:damage": 10,
    "minecraft:custom_name": ""
  }
}

For full documentation, see NBT Requirement.

Last updated