# Components Requirement

This is essentially the 1.21+ version of an NBT requirement, which checks an item's [data components](https://minecraft.wiki/w/Data_component_format).&#x20;

{% hint style="info" %}
**Note:**&#x20;

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](/cold-sweat/datapacks/requirements/nbt-requirement.md#numerical-ranges).&#x20;

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.
{% endhint %}

Example:

```json
{
  "components": {
    // Taken between 0 and 10 damage
    "minecraft:damage": "0:10",
    // Has these enchantments
    "minecraft:enchantments": {
      "minecraft:blast_protection": 2,
      "minecraft:sharpness": 3
    }
  }
}
```

<h4 align="center"><strong>For full documentation, see</strong> <a href="/pages/RhYcxAxvFCtltPcHm3LF"><strong>NBT Requirement</strong></a><strong>.</strong></h4>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mikul.gitbook.io/cold-sweat/datapacks/requirements/components-requirement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
