Chance Action - apace100/origins-fabric GitHub Wiki

Usable as any action. Executes the provided action only with a given random chance.

Type ID: origins:chance

Fields:

action, Actions: The action which might be executed.

chance, float: The chance that the action will execute, from 0 to 1. (E.g. 0.1 means 10% chance, 0.95 means 95% chance)

Example:

"entity_action": {
  "type": "origins:chance",
  "action": {
    "type": "origins:set_on_fire",
    "duration": 5
  },
  "chance": 0.4
}

This action has a 40% chance to set the player on fire for 5 seconds.