自定义变量符

你可以通过自定义变量符来制作自己想要实现的变量符。在自定义变量符中也可以使用其他变量符,并将它们使用 数学计算 一节介绍的函数、计算,加强几个插件之间的互联程度。

自定义变量符的相关配置可以在 plugins/libreforge/config.yml 中找到:

placeholders:
  - id: "example_placeholder" # 变量符ID
    value: "这是一个示例变量符!" # 变量符值

  - id: "example_expression_placeholder"
    value: "%level% * 2" # 支持数学计算

  - id: "conditional_placeholder"
    default: 5 # 默认值
    values:
      - conditions: # 使用条件格式
          - id: has_permission
            args:
              permission: "ecomc.rank.netherite"
            value: 20 # 满足该条件的玩家将会显示这个值

      - conditions:
          - id: has_permission
            args:
              permission: "ecomc.rank.diamond"
            value: 10

你可以按此格式添加无数多的自定义变量符。

你可以通过使用 %libreforge_变量符ID% 以显示对应自定义变量符的值。(需要 PlaceholderAPI)

Last updated