> For the complete documentation index, see [llms.txt](https://mikul.gitbook.io/cold-sweat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mikul.gitbook.io/cold-sweat/datapacks/requirements/item-requirement.md).

# Item Requirement

An item requirement is a set of criteria that an item must meet. They currently support checking:

* Item IDs and tags
* Item count (though most things don't check this)
* durability
* enchantments (including enchanted books)
* potion type (for potion items)
* nbt (1.20-) or components (1.21+)

These are modeled after Vanilla's item predicates, and are structured like so:

<pre class="language-json" data-full-width="false"><code class="lang-json">{
  // The items or item tags
  "items": [
    "minecraft:iron_chestplate",
    "#forge:armors/helmets"
  ],
  // Isn't used in most cases, but Vanilla's item predicates have it
  "count": {
    "min": 2,
    "max": 8
  },
  // Remaining durability on the item
  "durability": {
    "min": 100,
    "max": 150
  },
  // Also supports tags, but there aren't any enchantment tags in Vanilla
  "enchantments": [
    {
      "enchantment": "minecraft:flame",
      "levels": {
        "min": 1,
        "max": 2
      }
    },
    // "levels" field is optional. Any level of "infinity" is accepted
    {
      "enchantment": "minecraft:infinity"
    }
  ],
  // The item's remaining durability must be within these bounds
  "durability": {
    "min": 1,
    "max": 100
  },
  // The item must be a lengthened fire resistance potion
  "potion": "minecraft:long_fire_resistance",
  // (1.20-) The item must have these NBT tags
  "nbt": {
    "SomeTag": true,
    "SomeOtherTag": "1:10"
    // NBT tags can be nested
    "SomeNestedCompoundTag": {
      "ThisTagValue": 42,
      "ThisTagName": "Ramphord Yortold"
    }
  },
  // (1.21+) The item must have these components
  "components": {
    // Item has between 1 and 50 durability lost
    "minecraft:damage": "1:50"
  }
<strong>}
</strong></code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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