-
Notifications
You must be signed in to change notification settings - Fork 6
Random System & How It Works
Want some more randomness in your rewards? Use this!
You can make 2 or more groups with the same amount. Pay2Spawn will pick one at random for you.
Many of the things that are capable of using randoms have radiobuttons in the configurator, but you can add them almost anywhere in your JSON file!
Lets say you want to add a random about of XP levels between 5 and 20.
- Make a new Playermodification type
- Select all the right options:
XP Levels
andAdd
- Enter the random tag in the amount field:
$random(5, 20)
- Test!
- Save your reward.
- Done.
**Important note1: ** BYTEs are used to represent true
or false
in NBT
**Important note1: ** <> are parameters that need to be filled with values!
- Can be used in: STRING, BYTE
- Format:
$random()
Use this to make randomly colored fireworks or leather armor (or other things?).
- Can be used in: INT[], INT, STRING
- Format:
$randomRGB()
or$randomRGB(<amount of colors>)
If you are using leather, use $randomRGB()
.
If you are using fireworks, witch support multiple colors in the particles, use $randomRGB(<amount of colors>)
- Can be used in: STRING
- Format:
$randomEntity
Really only useful in the regular entity reward.
- Can be used in: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, STRING
- Format:
$random[<list item 1>, <list item2>, <......>]
You can have as many list items as you'd like!
- Can be used in: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, STRING
- Format:
$random(<start>, <limit>)
This will generate a random number starting from to
You need random value to appear in more then 1 place? You can use this!
Format: $var(<name>, <random>)
!You need to put whatever your normal random expression was in the parameter, BUT WITHOUT THE "$"!
You have a command that does /say @a Spawned a random mob!
and an entity reward that spawns $randomEntity
You can use $var(entity, randomEntity)
instead of "a random mob" and "$randomEntity".
That would result in this: /say @a Spawned a $var(entity, randomEntity)!
and an entity reward that spawns $var(entity, randomEntity)
{ "name": "Test for github wiki", "amount": "50", "message": "", "countdown": "", "rewards": [ { "type": "entity", "data": { "SPAWNRADIUS": "INT:10", "name": "STRING:$var(entity, randomEntity)", "CustomName": "STRING:Your doom", "agro": "BYTE:0", "random": "BYTE:1", "RideThisMob": "BYTE:0", "throwTowardsPlayer": "BYTE:0" } }, { "type": "command", "data": { "command": "STRING:say @a Spawned a $var(entity, randomEntity)!" } } ] }