Explosion
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
Members
clearToBlow()
Clears the affected block positions of this Explosion.
static create(world as Level, x as double, y as double, z as double, size as float, causesFire as bool, mode as BlockInteraction, exploder as Entity = null, source as DamageSource = null) as Explosion
Parameters:
x: double
Type: double
y: double
Type: double
z: double
Type: double
size: float
Type: float
causesFire: bool
Type: bool
mode: ExplosionBlockInteraction
Type: ExplosionBlockInteraction
Return Type:
Explosion
Getter
Gets the damage source of this Explosion.
Return Type:
DamageSource
damageSource() as DamageSource
Gets the damage source of this Explosion.
Returns: The damage source of this Explosion.
Return Type:
DamageSource
explode()
Performs the first part of the explosion which is destroying the blocks.
finalizeExplosion(spawnParticles as bool)
Performs the second part of the explosion which is the sound, drops and if enabled the particles.
Parameters:
spawnParticles: bool
Type: bool
- Should particles be spawned. Getter
Gets the LivingEntity that caused this Explosion.
For example: If the Explosion was caused by TNT, it will return the PlayerEntity that placed it. If the Explosion was caused by a Creeper or another Entity directly, it will return that Entity. If the Explosion was caused by a Ghast fireball, it will return the Ghast.
If no Entity caused this Explosion (for example, if the Explosion was caused by TNT in a Desert Temple that generated in the world), then
You may need to cast the returned LivingEntity to not be nullable.
For example: If the Explosion was caused by TNT, it will return the PlayerEntity that placed it. If the Explosion was caused by a Creeper or another Entity directly, it will return that Entity. If the Explosion was caused by a Ghast fireball, it will return the Ghast.
If no Entity caused this Explosion (for example, if the Explosion was caused by TNT in a Desert Temple that generated in the world), then
null
is returned.You may need to cast the returned LivingEntity to not be nullable.
Return Type:
LivingEntity
indirectSourceEntity() as LivingEntity
Gets the LivingEntity that caused this Explosion.
For example: If the Explosion was caused by TNT, it will return the PlayerEntity that placed it. If the Explosion was caused by a Creeper or another Entity directly, it will return that Entity. If the Explosion was caused by a Ghast fireball, it will return the Ghast.
If no Entity caused this Explosion (for example, if the Explosion was caused by TNT in a Desert Temple that generated in the world), then
You may need to cast the returned LivingEntity to not be nullable.
For example: If the Explosion was caused by TNT, it will return the PlayerEntity that placed it. If the Explosion was caused by a Creeper or another Entity directly, it will return that Entity. If the Explosion was caused by a Ghast fireball, it will return the Ghast.
If no Entity caused this Explosion (for example, if the Explosion was caused by TNT in a Desert Temple that generated in the world), then
null
is returned.You may need to cast the returned LivingEntity to not be nullable.
Returns: The LivingEntity that caused this Explosion. null
if no LivingEntity caused it.
Return Type:
LivingEntity
Getter
playerKnockbackMap() as Vec3[Player]
Gets the player knockback map for this Explosion.
This map is only populated in Explosion#explode() so calling it before will return nothing.
This map is used to calculate the vectors that players around the explosion will be pushed back by.
This map is only populated in Explosion#explode() so calling it before will return nothing.
This map is used to calculate the vectors that players around the explosion will be pushed back by.
Returns: A Map of PlayerEntity to Vector3d depicting knockback vectors.