Storysss
本帖最后由 Storysss 于 2023-5-19 14:29 编辑

menu:
  title: 'Level Menu'
  rows: 5
bindings:
  chat: '/等级奖励'
panel:
  - layout:
    - '#########'
    - '|a b c d|'
    - '|e f g h|'
    - '|i j k l|'
    - '#########'
    items:
      '#':
        material: gray stained glass pane
      '|':
        material: cyan stained glass pane
      'a':
        material: chest
        name: '&a20级礼包'
        action:
          all:
          - check player level >= 20
          then: |-
            eco take 500
            title "20级 奖励!" subtitle "成功领取!"
          else: |-
            menu close
            sound entity.experience_orb.pickup by 1 1
            title "20级 奖励!" subtitle "无法领取!"

怎么搞一个 只能领取一次的条件  以及怎么查询玩家领取状态
这个条件数据能存到数据库里吗?给个具体例子

不懂的别回复



夜雨晨风丶
建议搭配lp权限。领取完之后给玩家一个权限。lp有对应变量查询玩家是否拥有权限

Storysss
夜雨晨风丶 发表于 2023-5-19 13:46
建议搭配lp权限。领取完之后给玩家一个权限。lp有对应变量查询玩家是否拥有权限 ...

我得整几十个领取的 不想整那么多权限

夜雨晨风丶
见v4的wiki持久变量
https://invero.trixey.cc/docs/advance/basic/persist_data

Storysss

夜雨晨风丶

Storysss

夜雨晨风丶

Storysss

夜雨晨风丶

Storysss
已自行解决         action:
          all:
          - check player level >= 20
          - context no 'player@20级礼包'
          then: |-
            context set 'player@20级礼包' to 'true'
            command "sep send %player_name% 20级礼包" as console
            menu close
            title "20级 奖励!" subtitle "成功领取!"
          else:
            if: context has 'player@20级礼包'
            then: |-
              menu close
              sound entity.experience_orb.pickup by 1 1
              title "20级 奖励!" subtitle "只能领取一次!"
            else: |-
              menu close
              sound entity.experience_orb.pickup by 1 1
              title "20级 奖励!" subtitle "等级不足!"