# 物品配置

## 语法格式

> ```
> items:
>   "ItemName":
>     material: TEXT
>     slot: #
> ```

**注意:**

所有的物品都会有一个名字，在这个例子中该物品叫做 `ItemName`。这个名字是唯一的，所以不存在第二个或者更多与它相同的名字。

## 材质

> ```
> material: TEXT
> ```
>
> > 支持的材料值：
> >
> > * [材料名称](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations#useful-links) (`stone`)
> >   * 玩家头颅 (`head-extended_clip`)
> >   * 头颅变量 (`head-%player_name%`)
> >   * 头颅变量参数 (`head-{target}`)
> >   * [基础头颅](https://minecraft-heads.com/) (`basehead-<base64 (Value field in the head's give command)>`)
> >   * [史诗头颅](https://songoda.com/marketplace/product/26) (`heads-<ID>`)
> >   * [多彩头颅](https://www.spigotmc.org/resources/head-database.14280/) (`hdb-<ID>`)
> >   * 材质[变量](https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders) (`placeholder-%player_item_in_hand%`)

在菜单中设置物品的材质

> 对于1.12.2或者更老的版本
>
> 使用 [Data](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#data) 来设置物品后面的data (冒号`:`后面的数字) 例:灰色羊毛
>
> ```
> material: WOOL
> data: 5
> ```

## Data

> ```
> data: #
> ```
>
> > 支持的data值:
> >
> > * 数字 (`1`)
> >   * 变量返还的数字 (`placeholder-%player_item_in_hand_data%`)

设置物品的耐久 (取决于[材质](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#material)的设置)

> 对于1.12.2或者更老的版本
>
> 这个设置将决定物品的 [数据值](https://minecraft-el.gamepedia.com/Data_values)(冒号`:`后面的数字) 和 耐久值(取决于[材质](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#material)的设置)

## 数量

> ```
> amount: #
> ```

在菜单中设置物品的数量

## 数字变量

> ```
> dynamic_amount: '%placeholder%'
> ```

在菜单中使用变量来设置物品的数量

## 自定义模型数据

> ```
> nbt_string: <Key>:<StringValue>
> nbt_int: <Key>:<IntegerValue>
> ```

允许使用材质包中的自定义模型来显示材质包中的自定义物品

> 如果您有其他用途，这项设置也可以设置其他NBT数据

## 旗帜属性

> ```
> banner_meta:
> - <dyecolor>;<patterntype>
> - <dyecolor>;<patterntype>
> ```
>
> * [燃料颜色列表](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/DyeColor.html)
> * [图案类型列表](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/banner/PatternType.html)

允许创建自定义旗帜(如果材质是一个旗帜则可以使用)

## RGB颜色

> ```
> rgb: #,#,#
> ```
>
> > 例子:
> >
> > ```
> > rgb: 38,192,210
> > ```
> >
> > ![](https://img.aboodyy.net/19.06.19_01-07.png)

设置皮革装备的RGB颜色(红色,绿色,蓝色)

## 显示名称

> ```
> display_name: "TEXT"
> ```

设置物品的显示名称，可以使用[变量](https://helpch.at/placeholders)和颜色代码

## Lore介绍

> ```
> lore:
>   - "TEXT"
>   - "TEXT"
> ```

设置物品的lore(在物品名称下面显示的文字)，可以在此设置中使用[变量](https://helpch.at/placeholders)和颜色代码以及换行符(`\n`)

## 插槽

> ```
> slot: #
> ```
>
> > 更多插槽:
> >
> > ```
> > slots:
> >   - #
> >   - #
> >   - #
> > ```

设置物品应该在菜单内的哪个插槽中

> * 插槽从0开始
> * 多个物品可以在同一个插槽中，但是必须使用[查看权限](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#view-requirement)和[优先级](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#priority)设置才能使其正常工作

![](https://i.imgur.com//lr41ykP.png)

&#x20;                                                                          箱子中的插槽编号

## 优先级

> ```
> priority: #
> ```

设置物品优先级，如果想在同一插槽中使用不同的物品(使用[查看条件](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#view-requirement)设置)

如果玩家有所需查看的条件，将优先查看优先级最高的物品，如果达到条件，就会显示该物品；反之则查看下一个物品，以此类推。

> 最大的优先级是 0
>
> 最小的优先级是 2147483647

## 查看条件

> ```
> view_requirement: 'EXPRESSION'
> ```

设置玩家可以查看相应物品的条件 ([优先级](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#priority)设置可以在同一个插槽中设置多个物品)

查看[条件](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/requirements)页面可以获取更多关于这个设置的值和如何去使用它

## 更新

> ```
> update: BOOLEAN # true or false
> ```

如果设置为true,则只会用变量来更新物品的显示名称和lores

![](https://i.imgur.com/iOKtT2A.gif)

一个简单的例子：更新设置如何在变量中工作

## 附魔

> ```
> enchantments:
>   - enchantmentid;level
>   - enchantmentid;level
> ```
>
> * [附魔列表](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html)

指定物品的附魔属性(选择隐藏附魔设置来隐藏附魔)

> 有些物品没有发光效果

## 隐藏附魔

> ```
> hide_enchantments: BOOLEAN # true or false
> ```

如果设置为true，则会隐藏你给该物品设置的附魔效果，将会使用物品说明(lores)中的[附魔设置](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#enchantments)

## 隐藏属性

> ```
> hide_attributes: BOOLEAN # true or false
> ```

如果设置为true,则会隐藏物品/防具的属性(e.g. 7 攻击力)

## 隐藏效果

> ```
> hide_effects: BOOLEAN # true or false
> ```

如果设置为true,则会隐藏物品介绍下方的药水效果

## 无限耐久

> ```
> unbreakable: BOOLEAN # true or false
> ```

如果设置为true,则显示物品为满耐久 且无法被破坏

## (Shift) 右/中/左键指令

> ```
> # left_click_commands: or
> # right_click_commands: or
> # middle_click_commands: or
> # shift_left_click_commands: or
> shift_right_click_commands:
>   - "[ACTIONTYPE] ACTION"
>   - "[ACTIONTYPE] ACTION"
> ```

当玩家点击该物品时应执行的指令/动作，从上往下顺序执行

[这里](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations#action-types)可以浏览所有动作类型和动作标记

## (Shift) 右/中/左键条件

> ```
> # left_click_requirement: or
> # right_click_requirement: or
> # middle_click_requirement: or
> # shift_left_click_requirement: or
> shift_right_click_requirement:
>   requirements: 'EXPRESSION'
>   deny_commands:
>     - "[ACTIONTYPE] ACTION"
>     - "[ACTIONTYPE] ACTION"
> ```

设置玩家点击该物品的条件 (浏览[条件](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/requirements)页面有更多关于 `EXPERSSION`的值的信息)

Deny指令(可选)是当玩家没有必要的要求时将要执行的操作但如果他这样做，但是如果这样做，将会执行[click commands](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations/item#shift-left-middle-right-click-commands)选项中指定的操作

[这里](https://wiki.helpch.at/clips-plugins/deluxemenus/options-and-configurations#action-types)可以浏览所有动作类型和动作标记


---

# 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://deluxemenu.wiki.complexstudio.net/xuan-xiang-pei-zhi/wu-pin-pei-zhi.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.
