Class Projectile

All Implemented Interfaces:
CommandSource, SyncedDataHolder, TraceableEntity, EntityAccess, Nameable, ScoreHolder, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, 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
  • 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_310133_)
      Overrides:
      restoreFrom in class Entity
    • tick

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

      private boolean checkLeftOwner()
    • getMovementToShoot

      public Vec3 getMovementToShoot(double p_335302_, double p_334829_, double p_334312_, float p_331363_, float p_330173_)
    • 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_329816_)
    • deflect

      public void deflect(ProjectileDeflection p_328550_, @Nullable Entity p_330074_, @Nullable Entity p_333528_, boolean p_328333_)
    • onDeflection

      protected void onDeflection(@Nullable Entity p_327965_, boolean p_335911_)
    • 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()
      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_313184_)
    • isPickable

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

      public float getPickRadius()
      Overrides:
      getPickRadius in class Entity