类 AmmoHitEntityEvent

java.lang.Object
net.neoforged.bus.api.Event
mod.chloeprime.gunsmithlib.api.common.AmmoHitEntityEvent
所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent

public class AmmoHitEntityEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
子弹命中任何实体时触发。 比 EntityHurtByGunEvent.Pre 先触发。 取消这个事件只能阻止后续对直接命中目标的伤害,而不能阻止子弹消失。
从以下版本开始:
5.2.0
  • 构造器概要

    构造器
    构造器
    说明
    AmmoHitEntityEvent(net.minecraft.world.level.Level level, net.minecraft.world.phys.EntityHitResult hitResult, net.minecraft.world.entity.Entity hitTarget, com.tacz.guns.entity.EntityKineticBullet ammo, boolean isHeadshot)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    com.tacz.guns.entity.EntityKineticBullet
     
    net.minecraft.world.phys.EntityHitResult
     
    net.minecraft.world.entity.Entity
     
    net.minecraft.world.level.Level
     
    boolean
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 net.neoforged.bus.api.ICancellableEvent

    isCanceled, setCanceled
  • 构造器详细资料

    • AmmoHitEntityEvent

      public AmmoHitEntityEvent(net.minecraft.world.level.Level level, net.minecraft.world.phys.EntityHitResult hitResult, net.minecraft.world.entity.Entity hitTarget, com.tacz.guns.entity.EntityKineticBullet ammo, boolean isHeadshot)
  • 方法详细资料

    • getLevel

      public net.minecraft.world.level.Level getLevel()
    • getHitResult

      public net.minecraft.world.phys.EntityHitResult getHitResult()
    • getHitTarget

      public net.minecraft.world.entity.Entity getHitTarget()
    • getAmmo

      public com.tacz.guns.entity.EntityKineticBullet getAmmo()
    • isHeadshot

      public boolean isHeadshot()