Skip to content
Daedalus1400 edited this page May 17, 2017 · 2 revisions

Description:

The chance condition checks the output of a random number generator.

Added in release version 0.2.0

Arguments:

type

Must be "chance".

value

Accepts a number. If "value" is negative, the condition will always return true.

Example Usage:

The following example represents a condition that has a 1 in 20 chance of being true:

{"type": "chance", "value": 20}

This is will evaluate as:

java.util.random.nextDouble() * 20 < 1;
Clone this wiki locally