🎉 [精灵]CompanionsPlus v3.0.0 版本已发布 ✨ 点击查看
Skip to content

菜单示例 ​

示例配置 ​

# 标题
title: '&e演示菜单'
# 打开命令
openCommand: 'mc'
# 打开物品
openItem: 'clock'
# 打开权限 权限格式: playerMenu.open.menu.yml 设置false表示不需要权限
permission: true
# 菜单大小
size: 54
# 打开本菜单播放的声音1.12+支持
# 音效列表 https://bukkit.windit.net/javadoc/org/bukkit/Sound.html
sound: ""
# 菜单 节点commands内容 支持变量
# [message] 发送消息 [allMessage] 发送消息给全服
# [title] 发送消息 [allTitle] 发送消息给全服  格式 title:subTitle
# [actionbar] 发送消息 [allActionbar] 发送消息给全服
# [command] 执行命令 [op] op身份执行命令(尽量不要使用这个,使用Console替代执行) [Console] 控制台执行命令
# [close] 关闭菜单 [server] 跨服 [open] 打开子菜单
# id 如果存在该节点, 配置中做修改请先删除id节点在进行修改
menu:
  '20':
    # 按钮坐标
    index: 20
    # 按钮名称
    name: '   &8[&c发送消息&8]'
    # 按钮材质
    material: ARROW
    lore:
      - "&f- &7点击发送消息"
    # 按钮是否附魔
    isEnchant: false
    # 隐藏属性效果1.8+ 默认值true
    hideFlag: true
    # 隐藏附魔效果1.8+ 默认值true
    hideEnchant: true 
    # 按钮的自定义材质
    custom-model-data: 0
    # 工具提示样式 1.21.2+
    tooltipStyle: ""
    # 自定义模型 1.21.2+
    itemModel: ""
    commands:
      - '[message] 你好'
      - '[title] 大标题:小标题'
      - '[actionbar] 你好'
  '21':
    index: 21
    name: '   &8[&c执行命令&8]'
    material: ARROW
    lore:
      - "&f- &7点击回到主城"
    isEnchant: false
    custom-model-data: 0
    commands:
      - '[command] say 执行命令'
      - '[Console] say 控制台执行命令'
  '22':
    index: 22
    name: '   &8[&c点券消费&8]'
    material: ARROW
    lore:
      - "&f- &7点击点券消费"
    isEnchant: false
    custom-model-data: 0
    # 需要花费100点券才能点击
    point: 100
    # 点击按钮播放的声音1.12+支持
    sound: "BLOCK_ANVIL_HIT"
    # 条件不满足播放的声音1.12+支持
    # 音效列表 https://bukkit.windit.net/javadoc/org/bukkit/Sound.html
    failSound: "BLOCK_CHEST_CLOSE"
    commands:
      - '[command] say 你开通了vip'
      - '[allMessage] 恭喜 %player_name% 开通了点券vip'
  '23':
    index: 23
    name: '   &8[&c金币消费&8]'
    material: ARROW
    lore:
      - "&f- &7点击金币消费"
    isEnchant: false
    custom-model-data: 0
    # 需要花费100金币才能点击
    money: 100
    commands:
      - '[command] say 你开通了金币vip'
      - '[allMessage] 恭喜 %player_name% 开通了金币vip'
  '24':
    index: 24
    name: '   &8[&c只能购买3次&8]'
    material: ARROW
    lore:
      - "&f- &7点击金币购买"
      - "&f- &7限制使用三次"
    isEnchant: false
    custom-model-data: 0
    # 需要花费100金币才能点击
    money: 100
    # 标识作用(如果是手动添加的id节点,请使用负数,不能重复,有id才能判断cd和limit)
    id: -1
    # 限制只能使用三次本按钮
    limit: 3
    commands:
      - '[command] say 你开通了金币vip'
      - '[allMessage] 恭喜 %player_name% 开通了金币vip'
  '29':
    index: 29
    name: '   &8[&c变量条件&8]'
    material: ARROW
    lore:
      - "&f- &7变量条件支持6种符号"
      - "&f- &7 = ; !=; >; <; >=; <="
      - "&f- &7 = ; !=; 无限制"
      - "&f- &7>; <; >=; <= 必须为数字"
    isEnchant: false
    custom-model-data: 0
    # 自定义条件
    conditions:
      - '%player_name% = 米饭'
      - '%player_money% > 100'
    commands:
      - '[message] say 你点击了该按钮'
  '30':
    index: 30
    name: '   &8[&c时间条件&8]'
    material: ARROW
    lore:
      - "&f- &7点击使用"
      - "&f- &7限制每10秒使用一次"
    isEnchant: false
    custom-model-data: 0
    # 标识作用(如果是手动添加的id节点,请使用负数,不能重复,有id才能判断cd和limit)
    id: -2
    # 单位秒
    cd: 10
    commands:
      - '[message] say 你点击了该按钮'
  '31':
    index: 31
    name: '   &8[&c头颅按钮&8]'
    material: PLAYER_HEAD
    lore:
      - "&f- &7头颅按钮"
      - "&f- &7可使用指定玩家名例如: menu"
      - "&f- &7也可使用玩家变量%player_name%"
    isEnchant: false
    # 头颅材质
    head: '%player_name%'
    custom-model-data: 0
    commands:
      - '[message] say 帅气的头颅'
  '32':
    index: 32
    name: '   &8[&c权限按钮&8]'
    material: REDSTONE
    lore:
      - "&f- &7权限按钮"
      - "&f- &7玩家需要有权限: abc才能看见该按钮"
    isEnchant: false
    # 权限节点
    permission: 'abc'
    custom-model-data: 0
    commands:
      - '[message] say 恭喜你发现了权限按钮'
  '38':
    index: 38
    name: '   &8[&c金币出售物品&8]'
    material: APPLE
    lore:
      - "&f- &7点击出售物品"
      - "&f- &7出售64个苹果获得100金币"
    isEnchant: false
    custom-model-data: 0
    # 商店类型 sell 是出售 buy 是购买
    shopType: 'sell'
    # 出售的商品 格式 物品材质:数量
    shopMaterial: "APPLE:64"
    # 商店金币价格
    shopMoney: 100
  '39':
    index: 39
    name: '   &8[&c金币购买物品&8]'
    material: APPLE
    lore:
      - "&f- &7点击购买物品"
      - "&f- &7100金币购买64个苹果"
    isEnchant: false
    custom-model-data: 0
    # 商店类型 sell 是出售 buy 是购买
    shopType: 'buy'
    # 出售的商品 格式 物品材质:数量
    shopMaterial: "APPLE:64"
    # 商店金币价格
    shopMoney: 100
  '40':
    index: 40
    name: '   &8[&c点券出售物品&8]'
    material: POTATO
    lore:
      - "&f- &7点击出售物品"
      - "&f- &7出售64个土豆获得100点券"
    isEnchant: false
    custom-model-data: 0
    # 商店类型 sell 是出售 buy 是购买
    shopType: 'sell'
    # 出售的商品 格式 物品材质:数量
    shopMaterial: "POTATO:64"
    # 商店点券价格
    shopPoint: 100
  '41':
    index: 41
    name: '   &8[&c点券购买物品&8]'
    material: POTATO
    lore:
      - "&f- &7点击收购物品"
      - "&f- &7100点券购买64个土豆"
    isEnchant: false
    custom-model-data: 0
    # 商店类型 sell 是出售 buy 是购买
    shopType: 'buy'
    # 出售的商品 格式 物品材质:数量
    shopMaterial: "POTATO:64"
    # 商店金币价格
    shopPoint: 100
  # 分隔板 index你可以多写坐标
  pane:
    enable: true
    index: 0,1,2,3,4,5,6,7,8,9,17,18,26,27,35,36,44,45,46,47,48,49,50,51,52,53
    material: BLACK_STAINED_GLASS_PANE
    isEnchant: false
    name: "       &8[&7分割板&8]"
    lore:
      - "&7哎呀,不要随便戳人家啦"
    custom-model-data: 0