RandomSource
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import crafttweaker.api.util.math.RandomSource;
Methods
Return Type: boolean
// RandomSource.nextBoolean() as boolean
myRandomSource.nextBoolean();
Return Type: double
// RandomSource.nextDouble() as double
myRandomSource.nextDouble();
Return Type: float
// RandomSource.nextFloat() as float
myRandomSource.nextFloat();
Return Type: double
// RandomSource.nextGaussian() as double
myRandomSource.nextGaussian();
Return Type: int
// RandomSource.nextInt() as int
myRandomSource.nextInt();
Return Type: int
RandomSource.nextInt(bound as int) as int
Parameter | Type |
---|---|
Parameter bound | Type int |
Return Type: int
RandomSource.nextInt(bound as int, origin as int) as int
Parameter | Type |
---|---|
Parameter bound | Type int |
Parameter origin | Type int |
Return Type: int
RandomSource.nextIntBetweenInclusive(origin as int, bound as int) as int
Parameter | Type |
---|---|
Parameter origin | Type int |
Parameter bound | Type int |
Return Type: long
// RandomSource.nextLong() as long
myRandomSource.nextLong();