Explosion
Cause an explosion for rockets, grenades, and more!
Last updated
Cause an explosion for rockets, grenades, and more!
Last updated
WeaponMechanics has a custom explosion system (We don't use the same code for TNT as most plugins do). This allows us to control every explosion aspect, like the shape and damage.
If you are using WorldGuard, you can disable explosions in regions. Check out for more information.
Controls how much knockback entities get from the explosion. Defaults to 1.0
. Set to 0.0
to disable knockback. Using numbers >1 will throw players faster and further.
An entity's exposure determines how much damage they take. Exposure is challenging to calculate and involves ray tracing. To minimize potential lag, you may want to change this setting.
Explosion_Exposure: DEFAULT
This method is just like vanilla, but it uses the most CPU. Great for weapons that have a long reload time or otherwise aren't used often.
The shape of the blocks that are blown up. Each shape uses it's own "arguments" in Explosion_Type_Data
. Check each shape for a simple example.
Replicates a vanilla explosion. Arguments:
Yield
-> The maximum distance from the center that blocks are broken.
For reference, tnt=4
, creeper=3
, charged creeper=6
Rays
-> The number of ray casts for each direction. Defaults to 16.
Increasing the number of rays may look better, but it costs more CPU.
The following example creates a large explosion with increased detail.
The DEFAULT
explosion shape cannot destroy blocks that vanilla explosions can break. For example, obsidian and bedrock cannot be broken. If you want to damage these blocks, use another shape, like SPHERE
.
Determines when the explosion triggers. For a Molotov, you probably want it to explode on impact. But for a frag, you probably want it to explode a fixed time after you throw it.
Delay_After_Impact
The delay, in ticks, between the "impact" and the explosion.
Remove_Projectile_On_Detonation
Use true
to remove the projectile after the explosion.
Impact_When
Spawn
-> Triggers after spawning. Good for frags.
Entity
-> Triggers after hitting an entity.
Block
-> Triggers after hitting a block.
The following example will cause the explosion 5 seconds (100 ticks) after shooting the projectile.
Cluster bombs use recursion, which means that explosions spawn projectiles, which spawn explosions (and so on).
Split_Projectile
Uses the Projectile serializer.
Defaults to the projectile used for the gun.
Projectile_Speed
Defaults to 30
.
Number_Of_Bombs
The number of projectiles to spawn for each explosion.
Number_Of_Splits
The number of iterations.
For most use cases, this number should be 1
.
Detonation
Same as Detonation, but now used for new projectiles.
Mechanics
The mechanics to trigger whenever a split occurs (good for playing a sound to warn players of the split).
@Source{}
-> The shooter of the weapon
@Target{}
-> The split location (not an entity).
Drops projectiles from the sky, good for flare guns.
Dropped_Projectile
Uses the Projectile serializer.
Defaults to the projectile used for the gun.
Minimum_Bombs
The minimum number of bombs to drop
Maximum_Bombs
The maximum number of bombs to drop.
Height
How high up to drop the bombs from
Defaults to 60 blocks
Vertical_Randomness
Adds some randomness, so bombs explode at different times.
Defaults to 5.0
(airstrike location can vary by 10 blocks).
Distance_Between_Bombs
The minimum distance between dropped bombs.
Defaults to 3.0
blocks.
Maximum_Distance_From_Center
Defines how far away (horizontally) the bombs can drop.
Defaults to 25.0
block radius.
Layers
Repeats the airstrike.
Defaults to 1
.
Delay_Between_Layers
The delay, in ticks, between repetitions.
Defaults to 40
ticks
Detonation
Same as Detonation, but used for the dropped bombs.
Mechanics
The mechanics to trigger whenever an airstrike spawns. Great for playing a "bombs away" sound.
@Source{}
-> The shooter of the airstrike.
@Target{}
-> The location of the projectile (not an entity).
Check out our Block Damage wiki for information!
Used together with the Block_Damage
feature. This regenerates blocks over time.
Regeneration isn't perfect. Anything that causes block updates (players breaking blocks, redstone loops, pistons, some entities, etc.) can cause regeneration issues.
Ticks_Before_Start
The time, in ticks, before the first blocks begin to regenerate.
Max_Blocks_Per_Update
How many blocks to regenerate for each update.
Ticks_Between_Updates
The time, in ticks, between regenerations.
Let's you execute mechanics on people who are looking at the explosion.
Effect_Distance
The maximum distance away an entity should be to be safe.
Mechanics
The mechanics to trigger on each victim.
@Source{}
the shooter of the weapon.
@Target{}
the victim who was flash banged.
The following example will blind all players affected by the flashbang:
Mechanics to trigger when the explosion occurs. Used to play an explosion sound usually.
@Source{}
-> The shooter of the weapon.
@Target{}
-> The location of the explosion (not an entity).
This explosion breaks a few specific blocks (see below) in a 5.5-block radius. Blocks begin to regenerate after 2 minutes.
Bedrock, obsidian, and netherite cannot be damaged. Any material with "glass" in its name is broken in 2 shots, except for any material with "glass_pane" in the name, which can be broken in 1 shot. Any material with "wood" in the name can be broken in 6 shots, and dirt can be broken in 4 shots. All other materials cannot be broken, but they appear to take 12 shots of damage and show the crack animation. 10 seconds after a block is broken, it is regenerated.
Notice how $glass_pane
is below $glass$
. This is because order matters. When using the wildcard character $
, make sure to use the "more general blocks" (Like any glass block) before the "more specific blocks" (Like any glass pane).
The speed, in , that the projectile should spawn with.
See the wiki.
Use the wiki.
Hopper-reliant systems, like item sorters, are almost guaranteed to break during regeneration. Protect your regions using .
Use the wiki.