Explosion
Link to explosion
Импорт класса
Link to импорт-класса
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 Copyimport crafttweaker.api.world.Explosion;
Static Methods
Link to static-methods
Name: create
Return Type: Explosion
ZenScript CopyExplosion.create(world as MCWorld, x as double, y as double, z as double, size as float, causesFire as boolean, mode as ExplosionMode, exploder as MCEntity, source as DamageSource) as Explosion
Параметр | Тип | Описание | Optional | DefaultValue |
---|---|---|---|---|
Параметр world | Тип MCWorld | Описание No Description Provided | Optional false | DefaultValue |
Параметр x | Тип double | Описание No Description Provided | Optional false | DefaultValue |
Параметр y | Тип double | Описание No Description Provided | Optional false | DefaultValue |
Параметр z | Тип double | Описание No Description Provided | Optional false | DefaultValue |
Параметр size | Тип float | Описание No Description Provided | Optional false | DefaultValue |
Параметр causesFire | Тип boolean | Описание No Description Provided | Optional false | DefaultValue |
Параметр mode | Тип ExplosionMode | Описание No Description Provided | Optional false | DefaultValue |
Параметр exploder | Тип MCEntity | Описание No Description Provided | Optional true | DefaultValue |
Параметр источник | Тип DamageSource | Описание No Description Provided | Optional true | DefaultValue |
Методы
Link to методы
Name: clearAffectedBlockPositions
Clears the affected block positions of this Explosion.
Return Type: void
ZenScript Copy// Explosion.clearAffectedBlockPositions() as void
myExplosion.clearAffectedBlockPositions();
Name: doExplosionA
Performs the first part of the explosion which is destroying the blocks.
Return Type: void
ZenScript Copy// Explosion.doExplosionA() as void
myExplosion.doExplosionA();
Name: doExplosionB
Performs the second part of the explosion which is the sound, drops and if enabled the particles.
Return Type: void
ZenScript Copy// Explosion.doExplosionB(spawnParticles as boolean) as void
myExplosion.doExplosionB(true);
Параметр | Тип | Описание |
---|---|---|
Параметр spawnParticles | Тип boolean | Описание Should particles be spawned. |
Name: getAffectedBlockPositions
Return Type: stdlib.List<BlockPos>
ZenScript Copy// Explosion.getAffectedBlockPositions() as stdlib.List<BlockPos>
myExplosion.getAffectedBlockPositions();
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: getExploder
Gets the actual Entity that caused this Explosion to occur.
Examples: TNT will return itself. Creeper will return itself. A Ghast fireball will return itself.
You may need to cast the returned Entity to not be nullable.
Returns: The Entity that caused this Explosion. If the Explosion wasn't caused by any Entity, it will return null.
Return Type: MCEntity?
ZenScript Copy// Explosion.getExploder() as MCEntity?
myExplosion.getExploder();
Name: getExplosivePlacedBy
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: MCLivingEntity?
ZenScript Copy// Explosion.getExplosivePlacedBy() as MCLivingEntity?
myExplosion.getExplosivePlacedBy();
Name: getPlayerKnockbackMap
Gets the player knockback map for this Explosion.
This map is only populated in Explosion#doExplosionA() 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: MCVector3d[MCPlayerEntity]
ZenScript Copy// Explosion.getPlayerKnockbackMap() as MCVector3d[MCPlayerEntity]
myExplosion.getPlayerKnockbackMap();
Name: getPosition
Return Type: MCVector3d
ZenScript Copy// Explosion.getPosition() as MCVector3d
myExplosion.getPosition();
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название | Тип MCEntity? | Имеет Getter true | Имеет Setter false | Описание Gets the actual Entity that caused this Explosion to occur. Examples: TNT will return itself. Creeper will return itself. A Ghast fireball will return itself. You may need to cast the returned Entity to not be nullable. |
Название affectedBlockPositions | Тип stdlib.List<BlockPos> | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название damageSource | Тип DamageSource | Имеет Getter true | Имеет Setter false | Описание Gets the damage source of this Explosion. |
Название explosivePlacedBy | Тип MCLivingEntity? | Имеет Getter true | Имеет Setter false | Описание 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. |
Название playerKnockbackMap | Тип MCVector3d[MCPlayerEntity] | Имеет Getter true | Имеет Setter false | Описание Gets the player knockback map for this Explosion. This map is only populated in Explosion#doExplosionA() 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. |
Название position | Тип MCVector3d | Имеет Getter true | Имеет Setter false | Описание No Description Provided |