You need to run some commands once (or on every /reload
).
scoreboard objectives add random dummy
execute unless score seed random matches -2147483648.. run scoreboard players set seed random 731031
scoreboard players set mult random 1664525
scoreboard players set incr random 1013904223
scoreboard players set #16 random 16
Whenever you need a random output between 0 and a max number, you can call this function. It will store a random number from 0 (inclusive) to max (exclusive) in result random
.
scoreboard players operation seed random *= mult random
scoreboard players operation seed random += incr random
scoreboard players operation result random = seed random
scoreboard players operation result random /= #16 random
scoreboard players operation result random %= max random
you shud add a prefix to ur fakeplayers like a # so fx
scoreboard players set #mult random 1664525
scoreboard players set #incr random 1013904223