Class Projectile

All Implemented Interfaces:
CommandSource, SyncedDataHolder, TraceableEntity, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, INBTSerializable<CompoundTag>
Direct Known Subclasses:
AbstractArrow, AbstractHurtingProjectile, FireworkRocketEntity, FishingHook, LlamaSpit, ShulkerBullet, ThrowableProjectile

public abstract class Projectile extends Entity implements TraceableEntity
  • Field Details

    • ownerUUID

      @Nullable private UUID ownerUUID
    • cachedOwner

      @Nullable private Entity cachedOwner
    • leftOwner

      private boolean leftOwner
    • hasBeenShot

      private boolean hasBeenShot
    • lastDeflectedBy

      @Nullable private Entity lastDeflectedBy
  • Constructor Details

  • Method Details

    • setOwner

      public void setOwner(@Nullable Entity p_37263_)
    • getOwner

      @Nullable public Entity getOwner()
      Specified by:
      getOwner in interface TraceableEntity
    • getEffectSource

      public Entity getEffectSource()
    • addAdditionalSaveData

      protected void addAdditionalSaveData(CompoundTag p_37265_)
      Specified by:
      addAdditionalSaveData in class Entity
    • ownedBy

      protected boolean ownedBy(Entity p_150172_)
    • readAdditionalSaveData

      protected void readAdditionalSaveData(CompoundTag p_37262_)
      Specified by:
      readAdditionalSaveData in class Entity
    • restoreFrom

      public void restoreFrom(Entity p_305838_)
      Overrides:
      restoreFrom in class Entity
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • checkLeftOwner

      private boolean checkLeftOwner()
    • getMovementToShoot

      public Vec3 getMovementToShoot(double p_338345_, double p_338731_, double p_338427_, float p_338430_, float p_338697_)
    • shoot

      public void shoot(double p_37266_, double p_37267_, double p_37268_, float p_37269_, float p_37270_)
    • shootFromRotation

      public void shootFromRotation(Entity p_37252_, float p_37253_, float p_37254_, float p_37255_, float p_37256_, float p_37257_)
    • hitTargetOrDeflectSelf

      protected ProjectileDeflection hitTargetOrDeflectSelf(HitResult p_341949_)
    • deflect

      public boolean deflect(ProjectileDeflection p_341900_, @Nullable Entity p_341912_, @Nullable Entity p_341932_, boolean p_341948_)
    • onDeflection

      protected void onDeflection(@Nullable Entity p_341918_, boolean p_341907_)
    • onHit

      protected void onHit(HitResult p_37260_)
    • onHitEntity

      protected void onHitEntity(EntityHitResult p_37259_)
    • onHitBlock

      protected void onHitBlock(BlockHitResult p_37258_)
    • lerpMotion

      public void lerpMotion(double p_37279_, double p_37280_, double p_37281_)
      Overrides:
      lerpMotion in class Entity
    • canHitEntity

      protected boolean canHitEntity(Entity p_37250_)
    • updateRotation

      protected void updateRotation()
    • lerpRotation

      protected static float lerpRotation(float p_37274_, float p_37275_)
    • getAddEntityPacket

      public Packet<ClientGamePacketListener> getAddEntityPacket(ServerEntity p_352459_)
      Overrides:
      getAddEntityPacket in class Entity
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket p_150170_)
      Overrides:
      recreateFromPacket in class Entity
    • mayInteract

      public boolean mayInteract(Level p_150167_, BlockPos p_150168_)
      Overrides:
      mayInteract in class Entity
    • mayBreak

      public boolean mayBreak(Level p_307481_)
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class Entity
    • getPickRadius

      public float getPickRadius()
      Overrides:
      getPickRadius in class Entity
    • calculateHorizontalHurtKnockbackDirection

      public it.unimi.dsi.fastutil.doubles.DoubleDoubleImmutablePair calculateHorizontalHurtKnockbackDirection(LivingEntity p_344992_, DamageSource p_345905_)