Craftorithm Wiki
  • Craftorithm
  • 开始
    • 安装
    • 默认配置
    • 命令和权限
    • 本地化
    • 升级Craftorithm版本
  • 物品系统
    • 配置构成
    • 物品的保存与使用
    • 自定义燃料
  • 配方编写
    • 配置构成
    • 有序配方
    • 无序配方
    • 烧炼配方
    • 锻造配方
    • 切石机配方
    • 随机烧炼配方
    • 酿造配方
    • 铁砧配方
    • 在配方中使用物品Tag
    • 在配方中使用其他插件的物品
    • 配方分类
    • 通过GUI创建配方
  • 动作系统
    • 基础
      • 在配方中使用
    • 语句
      • Perm
      • Level
      • Money
      • Points
      • Papi
      • If
      • All
      • Any
      • Take-Level
      • Take-Money
      • Take-Points
      • Command
      • Console
      • Return
    • 进阶
      • 函数
  • 开发者相关
    • 物品提供源
    • 注册配方
由 GitBook 提供支持
在本页
  • 控制能否合成
  • 示例
  • 完整的配置文件示例
  • 合成后执行动作
  • 示例
  • 完整的配置文件示例
  1. 动作系统
  2. 基础

在配方中使用

在配方文件中使用动作系统

注意:目前支持工作台配方、铁砧配方和锻造台配方使用动作系统。

控制能否合成

当我们希望玩家要满足某条件时才能合成此配方,我们可以在配方文件中配置condition配置项。格式如下:

condition: '<动作语句>'

这里的动作语句会在返回结果后使用if进行包装,防止出现意外类型的返回值。

示例

玩家有权限"craftorithm.test"权限才能合成

condition: 'perm craftorithm.test'

玩家有权限"craftorithm.test"权限并且等级高于100级才能合成

condition: 'all perm craftorithm.test && level > 100'

玩家有权限"craftorithm.test"权限或玩家等级高于100级才能合成

condition: 'any perm craftorithm.test || level > 100'

玩家名字是"YufiriaMazenta"才能合成

condition: 'papi %player_name% == YufiriaMazenta'

完整的配置文件示例

type: 'shaped'
result: 'items:example_item:example_item'
multiple: true
shape:
  - - 'aaa'
    - 'bbb'
    - 'ccc'
  - - 'dd'
    - 'ee'
source:
  a: 'bedrock'
  b: 'command_block'
  c: 'items:example_item:example_item'
  d: 'diamond'
  e: 'iron_ingot'
unlock: true

condition: 'if all perm craftorithm.perm.example && level >= 100 && papi %player_name% == YufiriaMazenta'

合成后执行动作

当我们希望玩家合成某配方后执行一些动作,我们可以在配置文件中配置actions配置项。格式如下:

actions:
  - '动作1'
  - '动作2'
  ...

示例

当玩家合成后执行命令/me hello,并且给予玩家1级经验

actions:
  - 'command me hello'
  - 'take-level -1'

完整的配置文件示例

type: 'shaped'
result: 'items:example_item:example_item'
multiple: true
shape:
  - - 'aaa'
    - 'bbb'
    - 'ccc'
  - - 'dd'
    - 'ee'
source:
  a: 'bedrock'
  b: 'command_block'
  c: 'items:example_item:example_item'
  d: 'diamond'
  e: 'iron_ingot'
unlock: true

condition: 'if all perm craftorithm.perm.example && level >= 100 && papi %player_name% == YufiriaMazenta'
actions:
  - 'command me hello'
  - 'take-level -1'
上一页基础下一页语句

最后更新于1年前