> For the complete documentation index, see [llms.txt](https://mythicchanger.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mythicchanger.superiormc.cn/auto-match-and-change/rule.md).

# 📌Rule

Rule determines which items need to be modified and what they look like are determined by each rule in Auto Match\&Change feature.

## Rule Configs

All rules are existed at `rules` folder, you can copy `default.yml` to rename it to other words to create a new rule.

```yaml
weight: 15

only-in-player-inventory: true

# If you want to all item apply this rule, just delete whole match_item section.
match-item:
  items:
    - 'diamond_sword'
  # Whether you use item tier instead of item ID to identify item slots.
  # If this item plugin don't have tier, will still use Item ID as identify.
  #use-tier-identify: true
  #has-name: true
  #has-lore: true
  #contains-lore:
  #  - 'test'
  #contains-name:
  #  - 'test'

fake-changes:
  add-name-first: '&fGood '
  #set-name: '&fGood Diamond Sword'
  #add-lore:
  #  - '&f&lCommon'
  #set-lore:
  #  - '&7A good sword that all adventures should use!'
  #  - '&f&lCommon'
  #add-lore-prefix:
  #  - '%img_tooltip1%'
  #set-custom-model-data: 5
  #add-flags:
  #  - 'HIDE_ENCHANTS'

real-changes:
  add-enchants:
    KNOCKBACK: 1
  #remove-enchants:
  #  - 'POWER'
  #remove-all-enchants: true
  #delete-enchants:
  #  POWER: 3
  #replace-item:
  #  material: golden_sword
  
real-change-actions:
  1:
    type: message
    message: '&#98FB98[MythicChanger] &fChanged item!'

conditions:
  1:
    type: permission
    permission: 'mythicchanger.admin'
```

## General Options

* `weight` option represents this rule apply weight.
* `match-item` option represents which items will trigger this rule.
* `fake-changes` option represents what content will be modified at the client level.&#x20;
* `real-changes` option represents what content will be modified both in the client and server.
* `real-change-actions` option represents the action will executed when we applying real changes. Use **Action Format** here, for more info, please view [Format](/format/action-format.md) page. <mark style="color:red;">**PREMIUM VERSION ONLY.**</mark>
* `conditions` option represents players must meet those conditions to apply this rule. Use **Condition Format** here, for more info, please view [Format](/format/action-format.md) page.  <mark style="color:red;">**PREMIUM VERSION ONLY.**</mark>
* If you don't want to make fake or real change, you need delete the whole section instead of put empty value there!


---

# 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://mythicchanger.superiormc.cn/auto-match-and-change/rule.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.
