Random
Импорт класса
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.Random;
Methods
Return Type: string
Random.getRandomUUID() as string
myRandom.getRandomUUID();
Return Type: boolean
Random.nextBoolean() as boolean
myRandom.nextBoolean();
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
Return Type: double
Random.nextDouble() as double
myRandom.nextDouble();
Returns the next pseudorandom double. Its range is [min, max]
Return Type: double
Random.nextDouble(min as double, max as double) as double
Параметр | Тип | Description |
---|
min | double | No Description Provided |
max | double | No Description Provided |
Returns the next pseudorandom, uniformly distributed float value between 0.0f and 1.0f from this random number generator's sequence.
Return Type: float
Random.nextFloat() as float
myRandom.nextFloat();
Returns the next pseudorandom float. Its range is [min, max]
Return Type: float
Random.nextFloat(min as float, max as float) as float
Параметр | Тип | Description |
---|
min | float | No Description Provided |
max | float | No Description Provided |
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
Return Type: int
Random.nextInt() as int
myRandom.nextInt();
Returns the next pseudorandom, uniformly distributed int value between zero (inclusive) and bound (exclusive) from this random number generator's sequence
Return Type: int
Random.nextInt(bound as int) as int
Параметр | Тип | Description |
---|
bound | int | the upper bound (exclusive). Must be positive. |
Returns the next pseudorandom int. Its range is [min, max]
Return Type: int
Random.nextInt(min as int, max as int) as int
Параметр | Тип | Description |
---|
min | int | No Description Provided |
max | int | No Description Provided |