Class ExplosionKnockbackEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.ExplosionEvent
net.neoforged.neoforge.event.level.ExplosionKnockbackEvent
ExplosionKnockbackEvent is fired once the explosion has calculated the knockback velocity to add to the entity caught in blast.
This event is not
This event does not use
.
This event is fired on the
This event is not
ICancellableEvent
.This event does not use
invalid reference
HasResult
This event is fired on the
NeoForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.ExplosionEvent
ExplosionEvent.Detonate, ExplosionEvent.Start
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<net.minecraft.core.BlockPos> private final net.minecraft.world.entity.Entity
private net.minecraft.world.phys.Vec3
-
Constructor Summary
ConstructorsConstructorDescriptionExplosionKnockbackEvent
(net.minecraft.world.level.Level level, net.minecraft.world.level.ServerExplosion explosion, net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 knockbackVelocity, List<net.minecraft.core.BlockPos> blockList) -
Method Summary
Modifier and TypeMethodDescriptionList
<net.minecraft.core.BlockPos> return the list of blocks affected by the explosion.net.minecraft.world.entity.Entity
return the entity affected by the explosion knockback.net.minecraft.world.phys.Vec3
return the explosion knockback velocity to apply to entity.void
setKnockbackVelocity
(net.minecraft.world.phys.Vec3 newKnockbackVelocity) Sets the explosion knockback velocity to add to the entity's existing velocity.Methods inherited from class net.neoforged.neoforge.event.level.ExplosionEvent
getExplosion, getLevel
-
Field Details
-
entity
private final net.minecraft.world.entity.Entity entity -
blockList
-
knockbackVelocity
private net.minecraft.world.phys.Vec3 knockbackVelocity
-
-
Constructor Details
-
ExplosionKnockbackEvent
public ExplosionKnockbackEvent(net.minecraft.world.level.Level level, net.minecraft.world.level.ServerExplosion explosion, net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 knockbackVelocity, List<net.minecraft.core.BlockPos> blockList)
-
-
Method Details
-
getAffectedBlocks
return the list of blocks affected by the explosion. -
getAffectedEntity
public net.minecraft.world.entity.Entity getAffectedEntity()return the entity affected by the explosion knockback. -
getKnockbackVelocity
public net.minecraft.world.phys.Vec3 getKnockbackVelocity()return the explosion knockback velocity to apply to entity. -
setKnockbackVelocity
public void setKnockbackVelocity(net.minecraft.world.phys.Vec3 newKnockbackVelocity) Sets the explosion knockback velocity to add to the entity's existing velocity.
-