Skip to main content

Get 25% OFF on your first order with BisectHosting using code "DAQEM"!

Chance

The arc:chance condition type applies a random percentage chance for the action to proceed.

Parameters

ParameterTypeRequiredDefaultDescription
chancedoubleRequired-Percentage chance (0-100).

Example

The following example has a 50% chance to give a diamond when breaking dirt.

data/my_datapack/arc/lucky_dirt.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_break_block",
"conditions": [
{
"type": "arc:block",
"block": "minecraft:dirt"
},
{
"type": "arc:chance",
"chance": 50.0
}
],
"rewards": [
{
"type": "arc:item",
"item": {
"id": "minecraft:diamond"
}
}
]
}

Compatible Action Types