RandomSource

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.util.math.RandomSource;

Members

nextBoolean() as bool
script.zs
// RandomSource.nextBoolean() as bool;
myRandomSource.nextBoolean();

Return Type: bool

nextDouble() as double
script.zs
// RandomSource.nextDouble() as double;
myRandomSource.nextDouble();

Return Type: double

nextFloat() as float
script.zs
// RandomSource.nextFloat() as float;
myRandomSource.nextFloat();

Return Type: float

nextGaussian() as double
script.zs
// RandomSource.nextGaussian() as double;
myRandomSource.nextGaussian();

Return Type: double

nextInt() as int
script.zs
// RandomSource.nextInt() as int;
myRandomSource.nextInt();

Return Type: int

nextInt(bound as int) as int
script.zs
// RandomSource.nextInt(bound as int) as int;
myRandomSource.nextInt(myInt);

Parameters:

bound Type: int

Return Type: int

nextInt(bound as int, origin as int) as int
script.zs
// RandomSource.nextInt(bound as int, origin as int) as int;
myRandomSource.nextInt(myInt, myInt);

Parameters:

bound Type: int
origin Type: int

Return Type: int

nextIntBetweenInclusive(origin as int, bound as int) as int
script.zs
// RandomSource.nextIntBetweenInclusive(origin as int, bound as int) as int;
myRandomSource.nextIntBetweenInclusive(myInt, myInt);

Parameters:

origin Type: int
bound Type: int

Return Type: int

nextLong() as long
script.zs
// RandomSource.nextLong() as long;
myRandomSource.nextLong();

Return Type: long