Class ItemEntity

All Implemented Interfaces:
ICommandSource, INameable, ICapabilityProvider, ICapabilitySerializable<CompoundNBT>, IForgeEntity, INBTSerializable<CompoundNBT>

public class ItemEntity extends Entity
  • Field Details

    • DATA_ITEM

      private static final DataParameter<ItemStack> DATA_ITEM
    • age

      private int age
    • pickupDelay

      private int pickupDelay
    • health

      private int health
    • thrower

      private UUID thrower
    • owner

      private UUID owner
    • bobOffs

      public final float bobOffs
    • lifespan

      public int lifespan
      The maximum age of this EntityItem. The item is expired once this is reached.
  • Constructor Details

    • ItemEntity

      public ItemEntity(EntityType<? extends ItemEntity> p_i50217_1_, World p_i50217_2_)
    • ItemEntity

      public ItemEntity(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_)
    • ItemEntity

      public ItemEntity(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_)
    • ItemEntity

      private ItemEntity(ItemEntity p_i231561_1_)
  • Method Details

    • isMovementNoisy

      protected boolean isMovementNoisy()
      Overrides:
      isMovementNoisy in class Entity
    • defineSynchedData

      protected void defineSynchedData()
      Specified by:
      defineSynchedData in class Entity
    • tick

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

      private void setUnderwaterMovement()
    • setUnderLavaMovement

      private void setUnderLavaMovement()
    • mergeWithNeighbours

      private void mergeWithNeighbours()
    • isMergable

      private boolean isMergable()
    • tryToMerge

      private void tryToMerge(ItemEntity p_226530_1_)
    • areMergable

      public static boolean areMergable(ItemStack p_226532_0_, ItemStack p_226532_1_)
    • merge

      public static ItemStack merge(ItemStack p_226533_0_, ItemStack p_226533_1_, int p_226533_2_)
    • merge

      private static void merge(ItemEntity p_226531_0_, ItemStack p_226531_1_, ItemStack p_226531_2_)
    • merge

      private static void merge(ItemEntity p_213858_0_, ItemStack p_213858_1_, ItemEntity p_213858_2_, ItemStack p_213858_3_)
    • fireImmune

      public boolean fireImmune()
      Overrides:
      fireImmune in class Entity
    • hurt

      public boolean hurt(DamageSource p_70097_1_, float p_70097_2_)
      Overrides:
      hurt in class Entity
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundNBT p_213281_1_)
      Specified by:
      addAdditionalSaveData in class Entity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundNBT p_70037_1_)
      Specified by:
      readAdditionalSaveData in class Entity
    • playerTouch

      public void playerTouch(PlayerEntity p_70100_1_)
      Overrides:
      playerTouch in class Entity
    • getName

      public ITextComponent getName()
      Specified by:
      getName in interface INameable
      Overrides:
      getName in class Entity
    • isAttackable

      public boolean isAttackable()
      Overrides:
      isAttackable in class Entity
    • changeDimension

      @Nullable public Entity changeDimension(ServerWorld p_241206_1_, ITeleporter teleporter)
      Overrides:
      changeDimension in class Entity
    • getItem

      public ItemStack getItem()
    • setItem

      public void setItem(ItemStack p_92058_1_)
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(DataParameter<?> p_184206_1_)
      Overrides:
      onSyncedDataUpdated in class Entity
    • getOwner

      @Nullable public UUID getOwner()
    • setOwner

      public void setOwner(@Nullable UUID p_200217_1_)
    • getThrower

      @Nullable public UUID getThrower()
    • setThrower

      public void setThrower(@Nullable UUID p_200216_1_)
    • getAge

      public int getAge()
    • setDefaultPickUpDelay

      public void setDefaultPickUpDelay()
    • setNoPickUpDelay

      public void setNoPickUpDelay()
    • setNeverPickUp

      public void setNeverPickUp()
    • setPickUpDelay

      public void setPickUpDelay(int p_174867_1_)
    • hasPickUpDelay

      public boolean hasPickUpDelay()
    • setExtendedLifetime

      public void setExtendedLifetime()
    • makeFakeItem

      public void makeFakeItem()
    • getSpin

      public float getSpin(float p_234272_1_)
    • getAddEntityPacket

      public IPacket<?> getAddEntityPacket()
      Specified by:
      getAddEntityPacket in class Entity
    • copy

      public ItemEntity copy()