Random Chance
Executes the provided action only with a specific chance.
Type ID: origins:random_chance
Fields
| Field | Type | Default | Description |
|---|---|---|---|
success_action |
Action Type | The action that will be executed if the roll succeeds. | |
fail_action |
Action Type | optional | If specified, this action will be executed if the roll fails. |
chance |
Float | The chance that the action will execute, ranging from 0.0 to 1.0 (e.g: 0.1 means 10% chance, while 0.95 means 95% chance.) |
Examples
"entity_action": {
"type": "origins:random_chance",
"success_action": {
"type": "origins:set_on_fire",
"duration": 5
},
"chance": 0.4
}
This example has a 40% chance to set the entity on fire for 5 seconds.