> 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/change-rules/random.md).

# Random

{% hint style="info" %}
Using random type rules for **fake change** is <mark style="color:red;">**meaningless**</mark> because it will cause the item to constantly change (because each time player interact item, we will start fake change). Suggest using them only in **real changes**.\
Even using in **real change**, you need make sure **after random change, the item after change should NOT match the same rule again** otherwise the item will still constantly change because it still match the rule and randomly changed.

Example:

```yaml
match-item:
  items:
    - 'diamond'
  has-lore: false # This match rule make sure after change, the item will no longer be random changed by this rule.

real-changes:
  random-change:
    1:
      set-lore: 
        - 'Lucky Boy' # After change, the item will has lore, so it will only be changed once, otherwise it will always be changed by this rule.
      rate: 5
    2:
      set-lore: 
        - 'Not Lucky Boy'
      rate: 15
```

{% endhint %}

## Random Replace Item\* <mark style="color:red;">- Premium</mark>

Use the ItemFormat [here](https://ultimateshop.superiormc.cn/base/item-format).

```yaml
real-changes:
  replace-random-item:
    1:
      # Put Item Format here.
      material: APPLE
      rate: 5
    2:
      # Put Item Format here.
      material: DIAMOND
      rate: 15
```

## Random Change <mark style="color:red;">- Premium</mark>

```yaml
real-changes:
  random-change:
    1:
      # Put Change Rules here.
      set-lore: 
        - 'Lucky Boy'
      rate: 5
      actions:
        1:
          type: message
          message: 'So lucky!'
    2:
      set-lore: 
        - 'Not Lucky Boy'
      rate: 15
```


---

# 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/change-rules/random.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.
