Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Explosion

From SAS Gaming Wiki

Template:Redirect Template:Redirect

File:Minecraft-tnt-explosion.gif
A TNT explosion.

An explosion is a physical event, generally destructive, that occurs in several different circumstances. It can destroy nearby Minecraft:blocks, propel and damage nearby Minecraft:entities, and cause Minecraft:fires in some cases. Explosions produce a "shockwave" Minecraft:particle effect. Explosives include Minecraft:ghast fireballs, Minecraft:TNT, Minecraft:End crystals, Minecraft:beds when used outside of the Overworld, and Minecraft:respawn anchors when used outside of the Nether.

The propulsion effect of explosions is often used for TNT cannons.

Interaction with entities

Template:Exclusive

Velocity

Each affected entity is accelerated by between 0 and 1 blocks per game Minecraft:tick (0 to 20 blocks per second), added to its current velocity. This effect can accumulate over multiple explosions, even within a single tick.

The magnitude of the velocity given to each entity in the range of an explosion is calculated with the following code: <syntaxhighlight lang="java"> magnitude = (1 - distance/(2*power)) * exposure * knockbackMultiplier * (1 - EXPLOSION_KNOCKBACK_RESISTANCE) </syntaxhighlight> Or in formula form, <math>\left(1-\frac{\text{distance}}{2\cdot\text{power}}\right)\cdot\text{exposure}\cdot\text{knockback multiplier}\cdot\left(1-\text{explosion knockback resistance}\right)</math>.

Distance is measured from the explosion center to the entity's feet position. A list of explosion powers can be found in the Causes section. Exposure is discussed in the Exposure section. Explosion knockback resistance refers to the Minecraft:attribute explosion_knockback_resistance. The knockback multiplier depends on the cause:

Cause Knockback multiplier
Default 1.0
Wind charge 1.22 (Template:Wikipedia)

To calculate the final velocity, the game takes the vector pointing from the explosion center to the entity's eye position and sets its length to the previously calculated magnitude. Minecraft:TNT entities are the only exception, where the direction goes to the tnt's feet instead of its eyes.

Damage

The following code is used to calculate the damage inflicted on an entity:

<syntaxhighlight lang="java"> impact = (1 - distance/(2*power)) * exposure; damage = (float)((impact*impact + impact)/2 * 7*(2*power) + 1) </syntaxhighlight> In formula form, this is:

<math>\text{impact} = \left( 1- \frac{\text{distance}}{2 \cdot \text{power}} \right) \cdot \text{exposure}</math>

<math>\text{damage} = 7 \cdot \text{power} \cdot \left (\text {impact}^2 + \text{impact} \right) + 1</math>.

Players are damaged differently depending on Minecraft:difficulty. The main damage value is used to calculate the final damage in other difficulties:

Player damage per difficulty Template:Main
Difficulty Damage calculation
Minecraft:Peaceful No damage
Minecraft:Easy min(damage/2 + 1, damage)
Minecraft:Normal damage
Minecraft:Hard damage * 3/2

At the end of each game Minecraft:tick only the highest single explosion damage is chosen. Note that the main damage value has a +1 at the end, so all entities in range (within <math>2\cdot\text{power}</math>) of an explosion receive at least 1 damage even when the explosion is fully blocked. The only exceptions are invulnerable entities, Minecraft:Nether stars, and Peaceful players.

The Minecraft:Blast Protection enchantment and the Minecraft:Resistance effect are handled separately.

Calculator

Calculators/Explosion entity influence


Exposure

File:SampePointsTNT.svg
The sample points for the exposure calculation of TNT.

The exposure is a measurement of how much of the explosion is blocked by blocks. It ranges from 0 (when the explosion is entirely blocked) to 1 (when there are no obstructions).

To calculate the exposure, the game picks a set of sample points in the entity and casts rays from the explosion center to each point.

For each ray, the game checks if it intersects with any block hitbox. If it does, it is considered obstructed. The exposure is then calculated by dividing the number of unobstructed rays by the total number of rays.

Sample points

The sample points are arranged in a <math display="inline">\left\lceil2\cdot\mathsf{width}+1\right\rceil\times\left\lceil2\cdot\mathsf{height}+1\right\rceil\times\left\lceil2\cdot\mathsf{length}+1\right\rceil</math> 3D grid. <math display="inline">\mathsf{width}</math>, <math display="inline">\mathsf{height}</math>, and <math display="inline">\mathsf{length}</math> represent the X, Y, and Z dimension of the entity's bounding box respectively (measured in blocks).

Points on the grid are spaced by

<math display="block">\begin{bmatrix} \frac{\text{width}}{2\cdot\text{width}+1} \\ \frac{\text{height}}{2\cdot\text{height}+1} \\ \frac{\text{length}}{2\cdot\text{length}+1} \end{bmatrix}</math>

With the negative corner at

<math display="block">\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>

Edge cases

File:Explosion exposure raycasts interacting with fence gate.png
An explosion affecting a creeper through a fence gate. The collision boxes debug renderer is enabled to show the fence gate hitbox. Rays are only obstructed (red) if they intersect the full cube containing the fence. Unobstructed (green) rays can go through the fence hitbox otherwise.
  • Exposure is directionally biased (and the ray targets can sometimes be outside the entity) due to bug Template:Bug. This mostly affects small entities and entities that are far from a multiple of 0.5 wide.
  • The top of Minecraft:scaffolding only obstructs exposure rays if the feet position of the affected entity is above it. This has the effect of explosions appearing to travel down through scaffolding but not up.
  • For blocks whose collision box extends outside the full cube containing them (Minecraft:walls, Minecraft:fences, the back of Minecraft:piston arms, Minecraft:moving blocks, etc.), they only obstruct exposure rays if the rays intersect the full cube where the block is located.

Block destruction

File:ExplosionComparison.png
Comparison of explosion craters, from a charged creeper (left), Minecraft:TNT (center) and regular Minecraft:creeper (right).
File:ExplosionRay.png
The rays from the explosion center to points that are uniformly distributed on the surface of a cube. (this defines only their directions)

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 <math display="inline">\text{power} \cdot (\text{random value from 0.7 to 1.3})</math>.

For each ray, with the position starting at the explosion center:

  1. The game checks the block at the current position (this ignores block shape).
  2. If the block isn't air, intensity is reduced by <math display="inline">(\text{blast resistance} + 0.3) \cdot 0.3</math>.
  3. 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.
  4. Position is moved 0.3 blocks along the ray.
  5. Intensity is reduced by 0.22500001.
  6. If the remaining intensity is above 0, repeat from step 1. Otherwise, continue with the next ray.

This typically results in the maximum sphere of block damage having a radius of approximately 4/3 times the explosion power. This can be experimentally verified by repeating an explosion of a set explosion power at some coordinate inside blocks and measuring the radius of the resulting sphere of air.

After the process is done, the list of blocks to blow up is shuffled. For explosions that can cause Minecraft:fires, the game attempts to generate fire in Template:Frac 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 Minecraft:ender chests, Minecraft:enchanting tables, or any height of Minecraft:water or Minecraft:lava don't do block damage.

Dropping blocks

Blocks destroyed by explosions have a chance to drop items as if mined with an unenchanted diamond Minecraft:tool. Blocks destroyed by Minecraft:TNT have a 100% chance of dropping. Other explosions have a Template:Frac chance of dropping items. However, Minecraft:dragon eggs, Minecraft:beacons, Minecraft:conduits, Minecraft:heads, Minecraft:shulker boxes and Minecraft:decorated pots<ref>Template:Bug</ref> always drop from explosions.

The drop chance of blocks in explosions can be customized via three Minecraft:game rules: blockExplosionDropDecayTemplate:Only (includes Minecraft:End crystals), mobExplosionDropDecayTemplate: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.

Worlds created before 1.21 retain their old tntExplosionDropDecay settings. Upgraded worlds need to use Template:Cmd to get the new behavior.Template:Only<ref>https://bugs.mojang.com/browse/MCPE-56036?focusedId=1331407&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1331407</ref>

Causes

Cause Power Max. blast resistance Max. range Fire Affected by mobGriefing Notes
Template:EntityLink (Minecraft:ghast projectile) 1 3.49 Entity: 2
Block: 1.5
Template:Tc Template:Tc Can have its explosion power modified by editing its Entity data.
Template:EntityLink
Template:EntityLink
1 3.49 Entity: 2
Block: 1.5
Template:Tc Template:Tc Template:EntityLink:
Treats blocks breakable in Survival as having ≤ 0.8 blast resistance.
Template:EntityLink 3 12.16 Entity: 6
Block: 5.1
Template:Tc Template:Tc Can have its explosion power modified by editing its Entity data.
Template:BlockLink
Template:EntityLink
Template:BlockLinkTemplate:Only
4 16.49 Entity: 8
Block: 6.9
Template:Tc Template:Tc Template:EntityLink:
Gets up to an extra 7.5 explosion power (up to 11.5 total) based on the conditions under which it exploded.
Template:BlockLinkTemplate:Only:
Ignores water
The explosion center is approximately 0.06125 blocks above the TNT's position.
Template:BlockLink
Template:BlockLink
(when used in a wrong dimension)
5 20.83 Entity: 10
Block: 8.4
Template:Tc Template:Tc Death message:
"(player) was killed by [Intentional Game Design]"
Template:EntityLink (when destroyed) 6 25.16 Entity: 12
Block: 10.2
Template:Tc Template:Tc
Template:EntityLink 6 25.16 Entity: 12
Block: 10.2
Template:Tc Template:Tc Drops Minecraft:heads or skulls of Minecraft:mobs killed by explosion.

Can have its explosion power modified by editing its Entity data.

Template:EntityLink (when spawned, or when killedTemplate:Only) 7 29.49 Entity: 14
Block: 12
Template:Tc Template:Tc
Template:EntityLink
(half health charge move)Template:Only
8 -- Entity: 16
Block: 13.8
Template:Tc Template:Tc Breaks any block breakable in Survival (except reinforced deepslate), ignoring blast resistance.

Despite doing Minecraft:damage to Minecraft:entities, Minecraft:fireworks do not destroy terrain and as such are not counted as conventional explosions.

Minecraft:Lab tables sometimes perform a non-terrain-damaging explosion when creating Minecraft:garbage item.Template:Only

Blast resistance

The following table shows the blast resistance values used in Minecraft's code for all blocks. In Minecraft:add-on documentation for Template:BE, these values are multiplied by 5 when used for the Template:Cd value in the Template:Cd component. For example, Minecraft:cobblestone has a blast resistance of 6, so to make a custom block with the same blast resistance as cobblestone, quintuple that (which is 30) must be stored in its Template:Cd value.

[edit values]

Block name Blast resistance

Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table

Block name Blast resistance

Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table

Block name Blast resistance

Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion table Template:Explosion tableTemplate:Only Template:Explosion tableTemplate:Only Template:Explosion table Template:Explosion table


Sounds

Template:Edition Template:SoundTable

Template:Edition: Template:SoundTable

History

Template:Missing information

Development

Template:HistoryTable

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

Legacy Console Edition

Template:HistoryTable

Issues

Template:Issue list

Trivia

References

Template:Reflist

Navigation

Template:Navbox gameplay

Minecraft:de:Explosion Minecraft:es:Explosión Minecraft:fr:Explosion Minecraft:it:Esplosione Minecraft:ja:爆発 Minecraft:ko:폭발 Minecraft:nl:Explosie Minecraft:pl:Eksplozja Minecraft:pt:Explosão Minecraft:ru:Взрыв Minecraft:uk:Вибух Minecraft:zh:爆炸