Importare la Classe

Link to importare-la-classe

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.world.Explosion;

Name: create

Return Type: Explosion

ZenScript
Copy
Explosion.create(world as Level, x as double, y as double, z as double, size as float, causesFire as boolean, mode as ExplosionBlockInteraction, exploder as Entity, source as DamageSource) as Explosion
ParametroTipoDescrizioneOptionalDefaultValue
Parametro
world
Tipo
Level
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
x
Tipo
double
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
y
Tipo
double
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
z
Tipo
double
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
size
Tipo
float
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
causesFire
Tipo
boolean
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
mode
Tipo
ExplosionBlockInteraction
Descrizione
No Description Provided
Optional
no
DefaultValue
Parametro
exploder
Tipo
Entity
Descrizione
No Description Provided
Optional
DefaultValue
Parametro
sorgente
Tipo
DamageSource
Descrizione
No Description Provided
Optional
DefaultValue

Name: clearToBlow

Clears the affected block positions of this Explosion.

Return Type: void

ZenScript
Copy
// Explosion.clearToBlow() as void

myExplosion.clearToBlow();

Name: explode

Performs the first part of the explosion which is destroying the blocks.

Return Type: void

ZenScript
Copy
// Explosion.explode() as void

myExplosion.explode();

Link to finalizeExplosion

Name: finalizeExplosion

Performs the second part of the explosion which is the sound, drops and if enabled the particles.

Return Type: void

ZenScript
Copy
// Explosion.finalizeExplosion(spawnParticles as boolean) as void

myExplosion.finalizeExplosion(true);
ParametroTipoDescrizione
Parametro
spawnParticles
Tipo
boolean
Descrizione
Should particles be spawned.

Name: getDamageSource

Gets the damage source of this Explosion.

Returns: The damage source of this Explosion.
Return Type: DamageSource

ZenScript
Copy
// Explosion.getDamageSource() as DamageSource

myExplosion.getDamageSource();

Name: getHitPlayers

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.
Return Type: Vec3[Player]

ZenScript
Copy
// Explosion.getHitPlayers() as Vec3[Player]

myExplosion.getHitPlayers();

Name: getSourceMob

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.
Return Type: LivingEntity

ZenScript
Copy
// Explosion.getSourceMob() as LivingEntity

myExplosion.getSourceMob();

Name: getToBlow

Return Type: stdlib.List<BlockPos>

ZenScript
Copy
// Explosion.getToBlow() as stdlib.List<BlockPos>

myExplosion.getToBlow();
NomeTipoHa GetterHa SetterDescrizione
Nome
damageSource
Tipo
DamageSource
Ha Getter
Ha Setter
no
Descrizione
Gets the damage source of this Explosion.
Nome
playerKnockbackMap
Tipo
Vec3[Player]
Ha Getter
Ha Setter
no
Descrizione
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.
Nome
sourceMob
Tipo
LivingEntity
Ha Getter
Ha Setter
no
Descrizione
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.
Nome
toBlow
Tipo
stdlib.List<BlockPos>
Ha Getter
Ha Setter
no
Descrizione
No Description Provided