# 🔍Custom Item Match Method

## Default Item Match Method <a href="#default-item-match-method" id="default-item-match-method"></a>

### Vanilla Items <a href="#vanilla-items" id="vanilla-items"></a>

By default, we support two item price match method, they are:

* Bukkit: This match method require inventory's item must 100% same as the price item, if the item player has changed some thing, it can not be matched anymore. For example, add enchantments or change item name in anvil, they will change item's NBT info.
* ItemFormat: ItemFormat can set ignore list of item's vanilla NBT. If you add enchants and name in ignore list, then player can still use this item as price even the item has more enchantments or changed item name.

Example config:

```yaml
item-price:
  # Support Value: Bukkit or ItemFormat.
  # For each product, you can add match-item section to make custom match method, for more info, please view Wiki.
  check-method: Bukkit
  # Only support ItemFormat match method.
  item-format:
    require-same-key: false
    ignore-key:
      - 'lore'
      - 'damage'
      - 'enchants'
      - 'tool.damage-per-block'
      - 'nbt.CustomNBTKey'
```

For options in `item-format` section:

* require-same-key: This means that the items in the shop must have all the data of the items owned by the player.&#x20;
* ignore-key: The list of ItemFormat™ Key that will be ignored when check whether items are same.&#x20;

You can parse the ItemFormat of a handheld item by using the command `/fc generateeitemformat`, and the key can also be indented. For example, if you only want to ignore the sharpness enchantment and do not want to ignore other enchantments, you can fill in `enchants.sharpness` in ignore-keys option instead of `enchants`.

### Third-plugin Item <a href="#third-plugin-item" id="third-plugin-item"></a>

Items generated by [Supported Plugins](broken://pages/Ee0fZ4Z6Pl0L7sU8AVSa) will auto parse it's Item ID and compare it with the item ID you set in Item Format's `hook-item` option, so no matter how it changes, it will eventually match normally.

## Custom Match Method for each product - Require MythicChanger <a href="#custom-match-method-for-each-product-require-mythicchanger" id="custom-match-method-for-each-product-require-mythicchanger"></a>

Although the **ItemFormat** method described above solves the problem of items being modifiable, its flexibility is still insufficient. Therefore, this feature can help you set custom price match modes for each item price.

You can **add** a `match-item` section in the configuration of each **price**, which means that if the item meets this matching rule, it is considered match.

This feature require your server must install **MythicChanger** plugin, please get it here:

**FREE:** [Click to download](https://www.spigotmc.org/resources/mythicchanger-match-and-modify-all-your-items-without-trouble-1-14-1-21.98523/)

**PREMIUM:** [Click to download](https://www.spigotmc.org/resources/mythicchanger-premium-match-and-modify-all-your-items-without-trouble-1-14-1-21.115913/)

For how to configure the `match-item` section, please read MythicChanger's wiki, [click here to visit](https://mythicchanger.superiormc.cn/configs/match-item). Please note that some of the match rules require **PREMIUM version of MythicChanger.**

An example product config can be found at [this page](/totems/totem-config/prices-option-premium.md).


---

# 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://mythictotem.superiormc.cn/features/custom-item-match-method.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.
