minecraft:explode for you with a switch.Get GodCraftOverview
minecraft:explode is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the entity blow up, either right away or after a fuse, like a creeper or TNT. You control the size, fire, block damage and effects.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
allow_underwater | Boolean | "false" | Lets the explosion damage blocks and entities underwater. |
breaks_blocks | Boolean | "true" | Whether the explosion destroys blocks. |
causes_fire | Boolean | "false" | Whether the explosion leaves fire behind. |
damage_scaling | Decimal | "1.000000" | Multiplier for damage to entities; 0 deals no damage and negative values heal. |
destroy_affected_by_griefing | Boolean | "false" | If true, the mobGriefing game rule can stop it from breaking blocks. |
fire_affected_by_griefing | Boolean | "false" | If true, the mobGriefing game rule can stop it from starting fires. |
fuse_length | Range [a, b] | "[0.0, 0.0]" | Random time range in seconds before it explodes; a negative value explodes at once. |
fuse_lit | Boolean | "false" | Starts with the fuse already burning when the component is added. |
knockback_scaling | Decimal | "1.000000" | Multiplier for how hard the blast pushes entities away. |
max_resistance | Decimal | "3.40282e+38" | Caps how much blast resistance a block can have, so stronger blocks can still break. |
negates_fall_damage | Boolean | "false" | Cancels fall damage for players launched upward by the blast. |
particle_effect | String | "explosion" | Particles shown: "explosion", "wind_burst" or "breeze_wind_burst". |
power | Decimal | "3" | Blast size in blocks, which also sets how much damage it does. |
sound_effect | String | "explode" | Sound played when it explodes. |
toggles_blocks | Boolean | "false" | Flips blocks like doors, levers and trapdoors in the blast area instead of breaking them. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:explode": {
"allow_underwater": "false",
"breaks_blocks": "true",
"causes_fire": "false",
"damage_scaling": "1.000000",
"destroy_affected_by_griefing": "false",
"fire_affected_by_griefing": "false",
"fuse_length": "[0.0, 0.0]",
"fuse_lit": "false"
}
}