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.
new(level as Level, entity as Level, x as double, y as double, z as double, size as float, causesFire as bool, mode as BlockInteraction)
script.zs
// new Explosion(level as Level, entity as Level, x as double, y as double, z as double, size as float, causesFire as bool, mode as ExplosionBlockInteraction);
new Explosion(myLevel, myLevel, myDouble, myDouble, myDouble, myFloat, myBool, myBlockInteraction);
Parameters:
level: LevelType: Level
- The level to spawn the explosion in
entity: LevelType: Level
- The entity that spawned the explosion
x: doubleType: double
- The x position.
y: doubleType: double
- The y position.
z: doubleType: double
- The z position.
size: floatType: float
- How big is the explosion
causesFire: boolType: bool
- Does the explosion cause fire
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 null is returned. You may need to cast the returned LivingEntity to not be nullable.
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 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.
script.zs
// Explosion.indirectSourceEntity() as LivingEntity;
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.
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.
Returns: A Map of PlayerEntity to Vector3d depicting knockback vectors.
script.zs
// Explosion.playerKnockbackMap() as Vec3[Player];