Simple Statement cn - Glomzzz/RandomItem GitHub Wiki

简便声明

简便声明的格式:

{id}: '{id}-{type}:{value},{value},{value}'

如果你想让一个值为默认值 你可以让他为空 但是必须写它两边的"," 就像这样:

x: 'x-calculation:(1+(<quality.5>/2)) * \<Example\> * <strength> / 20,100,,,,2'

现在,让我们看看不同节点类型的简便声明参数吧!

strings

  • substrings : {substring-id};{weight};{values},...

例子:

example: 'example-strings:Example1;10;你好!,Example2;20;嗨!'

example:
  type: strings
  strings:
    Example1:
      weight: 10
      values:
        - '你好!'
    Example1:
      weight: 20
      values:
        - '嗨!'

效果相同

number

  • start
  • bound
  • fixed.integer.max
  • fixed.integer.min
  • fixed.demical.max
  • fixed.demical.min
  • decimal

例子:

强度: '强度-number:1,20,,,,,'

强度:
  type: number
  start: '1'
  bound: '20'

效果相同

compute

  • formula
  • max
  • fixed.integer.max
  • fixed.integer.min
  • fixed.demical.max
  • fixed.demical.min

例子:

x: 'x-compute:(1+(<quality.5>/2)) * <Example> * <strength> / 20,100,,,,-2'

x:
  type: compute
  max: 100
  fixed:
    decimal:
      min: 2
  formula: '(1+(<quality.5>/2)) * <Example> * <strength> / 20'

效果相同

javascript

  • script

例子:

script: 'script-javascript:
    var id = "<品质.id>";
    switch(id){
     case "粗糙":
     return 0;
     case "普通":
     return 1;
     case "良好":
     return 2;
     case "优秀":
     return 3;
     case "史诗":
     return 4;
     case "传说":
     return 5;
     default:
     return 114514;
     }'

script:
  type: javascript
  script: |
    var id = "<品质.id>";
    switch(id){
     case "粗糙":
     return 0;
     case "普通":
     return 1;
     case "良好":
     return 2;
     case "优秀":
     return 3;
     case "史诗":
     return 4;
     case "传说":
     return 5;
     default:
     return 114514;
     }

效果相同

lore

  • value1
  • value2
  • value3
  • ...

例子:

前缀词: '前缀词-lore:&7粗糙的 ,&a良好的 ,&5史诗的 '

前缀词:
  type: lore
  values:
    - '&7粗糙的 '
    - '&a良好的 '
    - '&5史诗的 '

效果相同


最后, 你知道如何简便声明一个节点了吗?

⚠️ **GitHub.com Fallback** ⚠️