自选礼包
← 返回 Wiki 首页
配置文件
编辑 gift_selector.yml:
gift_packs:
my_gift:
title: "&6&l自选礼包"
rows: 3 # GUI 行数 (1-6)
gift_material: "PLAYER_HEAD" # 礼包物品材质
gift_name: "&6&l礼包" # 礼包物品名称
multi_select: false # 是否多选
max_select: 1 # 多选时最多选几个
rewards:
1:
item_id: "flame_sword" # 物品ID(来自 ImportManager)
display_material: "DIAMOND_SWORD"
display_name: "&c火焰之剑"
lore:
- "&7一把燃烧的利剑"
glow: true # 附魔光效
amount: 1
2:
display_material: "DIAMOND"
display_name: "&b钻石 x10"
amount: 10
commands: # 用命令代替给物品
- "console:give {player} minecraft:diamond 10"
字段说明
| 字段 | 说明 |
|---|---|
title | GUI 窗口标题 |
rows | GUI 行数(1-6) |
gift_material | 礼包物品材质(如 PLAYER_HEAD、CHEST) |
gift_name | 礼包物品显示名称 |
multi_select | 是否允许选择多个奖励 |
max_select | 多选时最多可选数量 |
奖励字段
| 字段 | 说明 |
|---|---|
item_id | 物品 ID(来自 ImportManager,可选) |
display_material | GUI 中显示的物品材质 |
display_name | GUI 中的显示名称 |
lore | GUI 中的物品描述 |
glow | 是否显示附魔光效 |
amount | 数量 |
commands | 替代命令列表(可选) |
物品关联礼包
在物品 lore 中添加:
@MyItems, GiftSelector = my_gift
玩家右键该物品即可打开自选礼包 GUI。
示例:新手礼包
gift_packs:
newbie_gift:
title: "&a&l新手礼包 - 选择你的奖励"
rows: 3
gift_material: "CHEST"
gift_name: "&a&l新手礼包"
multi_select: false
max_select: 1
rewards:
1:
display_material: "DIAMOND_SWORD"
display_name: "&c战士之路"
lore:
- "&7选择战士路线"
- "&7获得一把钻石剑"
amount: 1
commands:
- "console:give {player} minecraft:diamond_sword 1"
2:
display_material: "BOW"
display_name: "&a射手之路"
lore:
- "&7选择射手路线"
- "&7获得一把弓和箭矢"
amount: 1
commands:
- "console:give {player} minecraft:bow 1"
- "console:give {player} minecraft:arrow 64"
3:
display_material: "ENCHANTED_BOOK"
display_name: "&b法师之路"
lore:
- "&7选择法师路线"
- "&7获得经验瓶"
amount: 1
commands:
- "console:give {player} minecraft:experience_bottle 32"