Pointing Data en - Glomzzz/RandomItem GitHub Wiki

Pointing Data

Note: This article takes the command /randomitem get [item ID] (Pointing data) as an example in the default configuration environment (/randomitem give [item ID] (Pointing data) is the same way)

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
  start: '1'
  bound: '20'
Example:
  type: number
  start: '10'
  bound: '20'
x:
  type: compute
  max: 100
  formula: '(1+(<quality.5>/2)) * <Example> * <strength> / 20'

Without Pointing Data

When we only enter /randomitem get [item ID]

RandomItem will ignores Pointing Data and assigns random values to random sections

For example: /randomitem get ExampleItem

Because there is no given Pointing Data, RandomItem will handle it normally

With Pointing Data

When we enter /random item get [item ID] (Pointing Data)

RandomItem processes the Pointing Data and assigns the specified value to the random sections with the specified value, and assigns the random value to the random sections without the specified value

For example: /random item get exampleitem [quality: Legend, strength: 20]

The Pointing Data [quality: Legendary, strength: 20] can play the following roles:

  • The value that specifies the quality of a string section is its substring section Legendary
  • The value that specifies the strength of the number section is 20
  • There is no given value for the number section example, so a random value of 10-20 is attached to it
  • There is no given value to calculation section x, so calculate its formula and assign value
⚠️ **GitHub.com Fallback** ⚠️