Explosion: Difference between revisions
(→Blast resistance: Added creaking heart.) |
mNo edit summary |
||
Line 24: | Line 24: | ||
<math>\begin{bmatrix} \frac{1}{2}\left(1-\frac{\lfloor2\cdot\text{width}+1\rfloor}{2\cdot\text{width}+1}\right) \\ 0 \\ \frac{1}{2}\left(1-\frac{\lfloor2\cdot\text{length}+1\rfloor}{2\cdot\text{length}+1}\right) \end{bmatrix}</math> |
<math>\begin{bmatrix} \frac{1}{2}\left(1-\frac{\lfloor2\cdot\text{width}+1\rfloor}{2\cdot\text{width}+1}\right) \\ 0 \\ \frac{1}{2}\left(1-\frac{\lfloor2\cdot\text{length}+1\rfloor}{2\cdot\text{length}+1}\right) \end{bmatrix}</math> |
||
For each ray, the game checks if it intersects with any block |
For each ray, the game checks if it intersects with any block hitbox. The exposure is the proportion of rays that remain unobstructed, and ranges from 0 to 1. These rays go from the entity to the explosion, so [[scaffolding]] blocks exposure when the explosion is below and the entity is above. Exposure is currently directionally biased (and the ray targets can sometimes be outside the entity) due to bug {{Bug|MC-232355}}. |
||
The '''impact''' for an entity can then be calculated with the following formula: |
The '''impact''' for an entity can then be calculated with the following formula: |
Revision as of 00:38, 14 January 2025

An explosion is a physical event, generally destructive, that occurs in several different circumstances. It can destroy nearby blocks, propel and damage nearby entities, and cause fires in some cases. Explosions produce a "shockwave" particle effect. Explosives include ghast fireballs, TNT, end crystals, and beds when not in the Overworld.
The propulsion effect of explosions is often used for TNT cannons.
Interaction with entities
Exposure and impact calculation

The explosion impact is used to calculate entity knockback and damage, and it depends on exposure. Impact is stronger the closer and less obstructed the entity is to the explosion.
To calculate the exposure of an entity, rays are cast from the explosion center to a
by by grid of points, spaced by
With the negative corner at
For each ray, the game checks if it intersects with any block hitbox. The exposure is the proportion of rays that remain unobstructed, and ranges from 0 to 1. These rays go from the entity to the explosion, so scaffolding blocks exposure when the explosion is below and the entity is above. Exposure is currently directionally biased (and the ray targets can sometimes be outside the entity) due to bug MC-232355.
The impact for an entity can then be calculated with the following formula:
With the distance measured from the explosion to the entity's feet position. See the Causes subsection for a list of explosion powers, and see Blast Protection for more information about blast protection.
Velocity
Each entity within range of an explosion is propelled away from it along the ray from the explosion center to the eyes of the entity, except TNT entities, where the ray goes to the feet of the TNT entity. The magnitude of this applied velocity is the impact.
Each affected entity is accelerated by between 0 and 1 blocks per game tick (0 to 20 blocks per second), added to its current velocity. This effect can accumulate over multiple explosions, even within a single tick.
Damage
Entities are damaged differently depending on difficulty. At the end of each game tick the highest amount of damage from all explosions is chosen.
The following term can be used to calculate the damage inflicted on an entity:
The Blast Protection enchantment and Resistance effect are handled separately. Explosions don't damage players in Peaceful difficulty. Nether stars cannot be destroyed by explosions.
Block destruction


On a small scale explosions form a roughly spherical crater. The size of that crater is dependent on the power of the explosion and the blast resistance of the destroyed blocks.
Calculating which blocks to destroy
To calculate the blocks affected, "rays" are created from the explosion center to the outer points of a 16 by 16 by 16 grid. Each of those rays gets an intensity of .
For each ray, with the position starting at the explosion center:
- The game checks the block at the current position (this ignores block shape).
- If the block isn't air, intensity is reduced by .
- If the remaining intensity is above 0 and the block can be blown up, it gets added to the list of blocks to blow up.
- Position is moved 0.3 blocks along the ray.
- Intensity is reduced by
0.22500001
. - If the remaining intensity is above 0, repeat from step 1. Otherwise, continue with the next ray.
After the process is done, the list of blocks to blow up is shuffled. For explosions that can cause fires, the game attempts to generate fire in 1⁄3 of the blocks in the list. This fire is successfully placed only when above an opaque block.
Due to the fact that the game ignores block shapes when checking blast resistance, explosions happening inside a non-full block get dampened heavily. Sufficiently weak explosions happening on ender chests, enchanting tables, or any height of water or lava do no block damage.
Dropping blocks
Blocks destroyed by explosions have a chance to drop items as if mined with an unenchanted diamond tool. Blocks destroyed by TNT have a 100% chance of dropping. Other explosions have a 1⁄power chance of dropping items. However, dragon eggs, beacons, conduits, heads, shulker boxes and decorated pots[1] always drop from explosions.
The drop chance of blocks in explosions can be customized via three game rules: blockExplosionDropDecay
[JE only] (includes end crystals), mobExplosionDropDecay
[JE only] and tntExplosionDropDecay
. Only tntExplosionDropDecay
is set to false
by default. If an explosion's drop decay is set to false
, items have a 100% chance of dropping.
in Bedrock Edition, worlds created before 1.21 retain their old tntExplosionDropDecay
settings. Upgraded worlds need to use /gamerule tntExplosionDropDecay false
to get the new behavior. [2]
Causes
Cause | Power | Max. blast resistance | Max. range | Fire | Affected by mobGriefing
|
Notes |
---|---|---|---|---|---|---|
![]() |
1 | 3 | Entity: 2 Block: 1.5 |
Yes | Yes | |
![]() ![]() |
1 | 3 | Entity: 2 Block: 1.5 |
No | Yes | ![]() Treats blocks breakable in Survival as having ≤ 0.8 blast resistance. |
![]() |
3 | 9 | Entity: 6 Block: 5.1 |
No | Yes | |
![]() ![]() |
4 | 9 | Entity: 8 Block: 6.9 |
No | No | ![]() Ignores Water The explosion center is approximately 0.06125 blocks above the TNT's position. |
![]() ![]() (when used in a wrong dimension) |
5 | 9 | Entity: 10 Block: 8.4 |
Yes | No | Death message: "(player) was killed by [Intentional Game Design]" |
![]() |
6 | 9 | Entity: 12 Block: 10.2 |
No | No | |
![]() |
6 | 9 | Entity: 12 Block: 10.2 |
No | Yes | Drops heads or skulls of mobs killed by explosion. |
![]() |
7 | 9 | Entity: 14 Block: 12 |
No | Yes | |
![]() (half health charge move)[BE only] |
8 | -- | Entity: 16 Block: 13.8 |
No | Yes | Breaks any block breakable in Survival (except reinforced deepslate), ignoring blast resistance. |
Despite doing damage to entities, fireworks do not destroy terrain and as such are not counted as conventional explosions.
Lab tables sometimes perform a non-terrain-damaging explosion when creating garbage item.[BE & edu only]
Blast resistance
The following table shows blast resistance values for blocks as shown in Minecraft's code. In Add-on documentation for Bedrock Edition, these values are multiplied by 5 when used for the "explosion_resistance" value in the "minecraft:descructible_by_explosion" component.
Sounds
[hide]Sounds | ||||||||
---|---|---|---|---|---|---|---|---|
Sound | Subtitles | Source | Description | Resource location | Translation key | Volume | Pitch | Attenuation distance |
Explosion | Blocks | When something explodes | entity | subtitles | 4.0 | 0.56-0.84 | 16 |
[hide]Sounds | |||||
---|---|---|---|---|---|
Sound | Source | Description | Resource location | Volume | Pitch |
Blocks | When something explodes | random | 4.0 | 1.0 |
History
May 21, 2009 | Notch shows interest in adding an explosive block. | ||||||
---|---|---|---|---|---|---|---|
[hide]Java Edition Classic | |||||||
0.24_SURVIVAL_TEST | Added creepers. | ||||||
October 24, 2009 | Showed off TNT. | ||||||
0.26 SURVIVAL TEST | Added TNT. | ||||||
[hide]Java Edition Indev | |||||||
0.31 | 20100122 | Explosions are now "better". | |||||
20100125-1 | Explosions now lose power when going through stronger materials. | ||||||
[hide]Java Edition Alpha | |||||||
v1.2.0 | preview | Added ghasts, which shoot explosive fireballs. | |||||
[hide]Java Edition Beta | |||||||
1.5 | Creepers now become charged when struck by lightning, increasing the explosion's radius and strength. | ||||||
1.6 | Test Build 3 | When the player tries to sleep in the Nether, they now cause the bed to explode. | |||||
1.8 | Pre-release | Explosions now emit shockwave particles. Prior to Beta 1.8, explosions emitted only smoke. | |||||
Sound Update | The 'Sound Update' on November 11th, 2011 gave TNT a new explosion sound. | ||||||
[hide]Java Edition | |||||||
1.0.0 | Beta 1.9 Prerelease 3 | Bed and fireball explosions now cause fires. | |||||
Beta 1.9 Prerelease 4 | When the player tries to sleep in the End, they now cause the bed to explode. | ||||||
Enchantment Blast Protection added, which can enhance an armor's resistance against explosions. | |||||||
Beta 1.9 Prerelease 6 | End crystals added, which can be destroyed with a melee or hit with an arrow or snowball, causing an explosion. | ||||||
1.3.1 | 12w24a | Fixed the issue of explosions not propelling players. | |||||
12w30a | Explosions now damage the player different amounts on different difficulties. However, no damage is dealt to the player on Peaceful. | ||||||
1.4.2 | 12w34a | Added the wither, which shoots black wither skulls. | |||||
12w37a | An emergent wither now makes a massive explosion when its health is fully charged. | ||||||
Blue wither skulls added. | |||||||
12w38b | New creeper fall mechanics have been added. Creepers now explode if they fall on the player from a certain height. | ||||||
1.5 | ? | Destroyed blocks now have a 1/power chance of dropping as items; previously it was a fixed 30% chance. | |||||
? | The Nether's biome now controls whether beds explode. As such, superflat worlds with this biome set have beds exploding in the Overworld. It is not known if Overworld biomes in the Nether allow sleeping as a result of this.[more information needed] | ||||||
1.8.2 | pre1 | Explosions are no longer directionally biased. | |||||
pre7 | Explosions no longer deal knockback to players in creative mode even if they are not flying. | ||||||
1.9 | 16w02a | Explosions once again deal knockback to players in creative mode but only if they are not flying. | |||||
1.14 | 19w11a | Destroyed blocks from TNT or minecart with TNT explosions now have a 100% chance of dropping as items. | |||||
1.15 | pre1 | Explosions no longer create smoke particles.[3] | |||||
1.16 | 20w12a | Added respawn anchors, which explode in a similar fashion to a bed, if charged and used in the Overworld and the End dimensions. | |||||
20w18a | The nether wastes biome no longer allows for beds to explode in the Overworld.[4][more information needed] | ||||||
1.16.2 | ? | Custom dimensions can specify whether beds and/or respawn anchors explode when used, | |||||
1.19.3 | 22w44a | Added the following game rules:
| |||||
[hide]Pocket Edition Alpha | |||||||
v0.1.0 | Added TNT. | ||||||
v0.2.1 | TNT now actually explodes. | ||||||
v0.4.0 | Added creepers. | ||||||
v0.12.1 | ? | Creepers now become charged when struck by lightning, increasing the explosion's radius and strength. | |||||
Added ghasts, which shoot explosive fireballs. | |||||||
Enchantment Blast Protection added, which can enhance an armor's resistance against explosions. | |||||||
When the player tries to sleep in the Nether, they cause beds to explode. | |||||||
? | Added explosion particles. | ||||||
TNT now uses a new explosion sound. | |||||||
v0.14.0 | ? | An invalid mixture of liquids in cauldrons now result in a non-damaging explosion effect. | |||||
v0.16.0 | build 4 | Withers added. | |||||
[hide]Pocket Edition | |||||||
1.0.0 | alpha 0.17.0.1 | End crystals added. | |||||
When the player tries to sleep in the End, they now cause the bed to explode. | |||||||
1.0.7 | Explosions no longer deal damage to a player, if the explosion is in water. | ||||||
[hide]Bedrock Edition | |||||||
1.4.0 | beta 1.2.20.1 | Creating garbage in lab table sometimes causes explosion sound. | |||||
Added underwater TNT, which can damage terrain underwater. | |||||||
? | Removed the non-damaging explosion effect from cauldrons, replaced with a hiss and smoke. | ||||||
1.21.0 | Preview 1.21.0.20 | Added the game rule tntExplosionDropDecay .
| |||||
TNT explosions now have a 100% item drop rate by default.[5] | |||||||
[hide]Legacy Console Edition | |||||||
Xbox 360 | Xbox One | PS3 | PS4 | PS Vita | Wii U | Switch | |
TU1 | CU1 | 1.00 | 1.00 | 1.00 | Patch 1 | 1.0.1 | Added tnt and creepers, which can explode. |
TU7 | Enchantment Blast Protection added, which can enhance an armor's resistance against explosions. | ||||||
TU9 | End crystals added, which can be destroyed with a melee or hit with an arrow or snowball, causing an explosion. | ||||||
TU14 | 1.04 | Explosions now damage the player different amounts on different difficulties. However, no damage is dealt to the player on Peaceful. | |||||
TU19 | CU7 | 1.12 | 1.12 | 1.12 | Added the wither, which shoots black wither skulls and Blue wither skulls. | ||
TU43 | CU33 | 1.36 | 1.36 | 1.36 | Patch 13 | Explosions no longer deal knockback to players, which are flying in creative mode. |
Trivia
- Explosions with a power greater than 100 look mostly the same from the outside, as only certain lines are used to determine if a block breaks. However, some of those lines continue underground.
- Explosions that occur in flowing water or lava apply propulsion and damage to entities, but don't affect any blocks, regardless of the blocks' blast resistance.
- Underwater explosions don't emit smoke particles.
- Explosions can redirect projectiles, including ender pearls.
- An explosion just after a mob's death can propel the mob's body.
- If a falling sand entity falls into primed TNT when in water, it deals block damage.
References
- ↑ MC-263554 — resolved as "Works As Intended".
- ↑ https://bugs.mojang.com/browse/MCPE-56036?focusedId=1331407&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1331407
- ↑ MC-165991
- ↑ MC-147255
- ↑ MCPE-56036 — TNT Does Not Have 100% Drop Rate — resolved as "Fixed".
[hide] | |
---|---|
General mechanics | |
Survival |
|
Combat | |
Environment | |
Movement | |
User interface | |
Visuals | |
Outdated | ![]() |