Configuration en - Glomzzz/RandomItem GitHub Wiki

Configs

config.yml

options:
  debug: false
  check-version: true
command:
  name: 'randomitem'
  aliases:
    - 'ri'
  permission: 'randomitem.admin'

lang\en_US.yml

prefix: '&d[&bRandomItem&d] '
item:
  save: '{0}&eSaved &b{1} &5&lX1 &esuccessfully!'
  get: '{0}&eYou have got &a{1} &5&lX{2}&e!'
  give: '{0}&eYou have given &a{2} &5&lX{3} &eto player &6{1}&e!'
  drop: '{0}&eYou let the random item &6{1} &5&lX{2} &edrop in the world &a{3} &e: &b{4}&c,&b{5}&c,&b{6}'
no-permission: '{0}&cYou don t have the permission to do this!'
only-player: '{0}&cThis command can only be used by players!'
valid:
  x-y-z: '{0}&cPlease check that the X, Y, Z coordinates you entered must be numeric!'
  number: '{0}&cThe page you entered must be numeric!'
  world: '{0}&cThe world &b{1} &cdoesn t exist!'
  item: '{0}&cThe item &b{1} &cdoesn t exist!'
  player: '{0}&cThe player &b{1} &cdoesn t exist!'
  save: '{0}&cThe &b{1} &ccan t be saved!'
  id: '{0}&cID &b{1} &cdoesn t exist! Skip!'
  network: '{0}&cFailed to link to server! Please check your network!'
  command: '{0}&cWrong sub command!'
list:
  value-of-one-page: 10
  up: '&d&l&m======================================='
  format: '&a{1}. &b -> &6{2} &5- &b{3}'
  page: '      &e{1}&5/&e{2}      '
  left: '  &b<-'
  right: '&b->  '
  down: '&d&l&m======================================='
reload:
  default: '{0}&eReloaded successfully!'
  config: '{0}&eFile &d&lconfig.yml &eupdated,And it has been loaded automatically!'
check-version:
  legacy: '{0}&cRandomItem has a new version &6 {1} &c, please go to&e https://www.spigotmc.org/resources/88226/ &cto download the latest version!'
  latest: '{0}&aYour RandomItem is the latest version!'
commands:
  - '&d&l&m================================================'
  - '&b/randomitem get [Item ID] (Amount Formula) (Chance Formula) (Is Same) (Point Data) '
  - ' &eTo get a RandomItem&e.'
  - '&b/randomitem give [Player Name] [Item ID] (Amount Formula) (Chance Formula) (Is Same) (Point Data) '
  - ' &eTo give somebody a RandomItem&e.'
  - '&b/randomitem list (Page)                   '
  - ' &eShow the RandomItem list.'
  - '&b/randomitem save [Item ID] [Path] '
  - ' &eTo save the item that in your hand.'
  - '&b/randomitem drop [Player Name] [Item ID] [Amount Formula] [Chance Formula] [Is Same] [World Name] [x] [y] [z]  '
  - ' &eTo drop RandomItem in somewhere.'
  - '&b/randomitem reload       '
  - ' &eTo reload the plugin&e. '
  - '&d[]is a required , () is optional . &cParameters must be entered in sequence'
  - 'Formulas support for PAPI and the four fundamental operations of arithmetic,Chance 0~1,Is Same -> weather or not generating same item.'
  - '&d(Point Data)’s format: &a[Random Section ID:Value,Random Section ID:Value]'
  - '&7The value of the string section is filled with the ID of its substring section'
  - '&7You can also use the format of &a[String Section ID:A,B,C]&7 to let only the three substrings A,B,C participate in the random weighting.'
  - '&d&l&m================================================'

GlobalSections\Basic.yml

quality:
  type: strings
  strings:
    Rough:
      weight: 45
      values:
        - 'STICK'
        - '&8Rough'
        - '&eQuality: &8Rough'
        - '&f_______&b<-&8Quality Attribute&b->&f_______'
        - ' &dDamage: &810 '
        - '0'
    Normal:
      weight: 35
      values:
        - 'WOOD_SWORD'
        - '&7Normal'
        - '&eQuality: &7Normal'
        - '&f_______&b<-&7Quality Attribute&b->&f_______'
        - ' &dDamage: &720 '
        - '0'
    Fine:
      weight: 10
      values:
        - 'STONE_SWORD'
        - '&3Fine'
        - '&eQuality: &eFine'
        - '&f_______&b<-&eQuality Attribute&b->&f_______'
        - ' &dDamage: &330 '
        - '0'
    Excellent:
      weight: 6
      values:
        - 'IRON_SWORD'
        - '&aExcellent'
        - '&eQuality: &aExcellent'
        - '&f_______&b<-&aQuality Attribute&b->&f_______'
        - ' &dDamage: &a50 '
        - '1'
    Epic:
      weight: 3
      values:
        - 'GOLD_SWORD'
        - '&5Epic'
        - '&eQuality: &5Epic'
        - '&f_______&b<-&5Quality Attribute&b->&f_______'
        - ' &dDamage: &570 '
        - '2'
    Legendary:
      weight: 1
      values:
        - 'DIAMOND_SWORD'
        - '&6Legendary'
        - '&eQuality: &6Legendary'
        - '&f_______&b<-&6Quality Attribute&b->&f_______'
        - ' &dDamage: &6100 '
        - '3'
strength:
  type: number
  #About how many decimal places, '0' means integer.
  fixed: 0
  start: '1'
  bound: '20'

GlobalSections\Script.yml

script:
  type: javascript
  script: |
    var id = <quality.data-json>.id;
    switch(id){
     case "Rough":
     return 1;
     case "Normal":
     return 2;
     case "Fine":
     return 3;
     case "Excellent":
     return 4;
     case "Epic":
     return 5;
     case "Legendary":
     return 6;
     default:
     return 0;
     }

Items\ExampleItem.yml

ExampleItem:
  display: '<quality.1> &9Big Sword♂'
  material: '<quality.0>'
  data: 0
  lores:
    - '<quality.2-4>'
    - '&f_______&b<-&8Basic Stats&b->&f_______'
    - '&6Damage: &b<x>'
    - ''
    - '&7The biggest&5♂ &7sword in the world...'
    - ''
    - '&eQuality Level: &b<script>'
    - ''
    - '&eStrength: &b<strength>'
  #0 = false , not 0 = true
  unbreakable: <quality.5>
  item-flags:
    - 'HIDE_ATTRIBUTES'
  #Supports to call the random section
  #For example:
  #  nbt-keys:
  #    Unbreakable: <quality.5>
  nbt-keys: { }
  enchantments:
    SWEEPING_EDGE: <quality.5>
  used-global-sections:
    - 'quality'
    - 'strength'
    - 'script'
  randoms:
    Example:
      type: number
      start: '10 * <script>'
      bound: '20 * <script>'
    x:
      type: compute
      max: 233
      fixed:
        decimal:
          max: 2
      formula: '(1+(<quality.5>/2)) * <Example> * <strength> / 20'
⚠️ **GitHub.com Fallback** ⚠️