这是本文档旧的修订版!
command
为每个提供的目标执行一个命令。 允许使用颜色代码和变量。有关颜色代码列表,请查看此处。变量可以在这里找到。 如果指定的命令包含双引号 “ 或大括号 {} 并且必须用它们各自的消息变量替换,则指定的命令将无法正常运行。发生这种情况因为双引号和大括号是为 MythicMobs 本身保留的,试图阅读您提供的语法。
属性
属性 | 缩写 | 描述 | 默认值 |
command | c | The command to execute | |
asCaster | ac | If true the command will execute from the caster instead of the console. | false |
asOp | op | Whether to execute the command with all permissions | false |
asTarget | at | Executes the command as the skill target | false |
requireTarget | rt | Only executes if the skill has a target | false |
例子
正确书写的命令技能
Skills: - command{c="give <target.name> gold_ingot 20"} @trigger ~onInteract - command{c="minecraft:tp <target.name> <mob.uuid>"} @self ~onDamaged - command{c="minecraft:summon Zombie ~ ~ ~ <&lc>NoAI:true,CustomName:<&dq>Summoned Zombie<&dq><&rc>"} - command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:<&dq>Summoned Zombie<&dq>}"}
无效的命令技能 下面的示例将不起作用,因为某些符号没有被消息变量替换。
Skills: - command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:"Summoned Zombie"}"}