Class ItemEntity

All Implemented Interfaces:
CommandSource, EntityAccess, Nameable, ICapabilityProvider, ICapabilitySerializable<CompoundTag>, IForgeEntity, INBTSerializable<CompoundTag>

public class ItemEntity extends Entity
  • Field Details

    • DATA_ITEM

      private static final EntityDataAccessor<ItemStack> DATA_ITEM
    • LIFETIME

      private static final int LIFETIME
      See Also:
      Constant Field Values
    • INFINITE_PICKUP_DELAY

      private static final int INFINITE_PICKUP_DELAY
      See Also:
      Constant Field Values
    • INFINITE_LIFETIME

      private static final int INFINITE_LIFETIME
      See Also:
      Constant Field Values
    • 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_31991_, Level p_31992_)
    • ItemEntity

      public ItemEntity(Level p_32001_, double p_32002_, double p_32003_, double p_32004_, ItemStack p_32005_)
    • ItemEntity

      public ItemEntity(Level p_149663_, double p_149664_, double p_149665_, double p_149666_, ItemStack p_149667_, double p_149668_, double p_149669_, double p_149670_)
    • ItemEntity

      private ItemEntity(ItemEntity p_31994_)
  • Method Details

    • occludesVibrations

      public boolean occludesVibrations()
      Overrides:
      occludesVibrations in class Entity
    • getMovementEmission

      protected Entity.MovementEmission getMovementEmission()
      Overrides:
      getMovementEmission 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_32016_)
    • areMergable

      public static boolean areMergable(ItemStack p_32027_, ItemStack p_32028_)
    • merge

      public static ItemStack merge(ItemStack p_32030_, ItemStack p_32031_, int p_32032_)
    • merge

      private static void merge(ItemEntity p_32023_, ItemStack p_32024_, ItemStack p_32025_)
    • merge

      private static void merge(ItemEntity p_32018_, ItemStack p_32019_, ItemEntity p_32020_, ItemStack p_32021_)
    • fireImmune

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

      public boolean hurt(DamageSource p_32013_, float p_32014_)
      Overrides:
      hurt in class Entity
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag p_32050_)
      Specified by:
      addAdditionalSaveData in class Entity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag p_32034_)
      Specified by:
      readAdditionalSaveData in class Entity
    • playerTouch

      public void playerTouch(Player p_32040_)
      Overrides:
      playerTouch in class Entity
    • getName

      public Component getName()
      Specified by:
      getName in interface Nameable
      Overrides:
      getName in class Entity
    • isAttackable

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

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

      public ItemStack getItem()
    • setItem

      public void setItem(ItemStack p_32046_)
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> p_32036_)
      Overrides:
      onSyncedDataUpdated in class Entity
    • getOwner

      @Nullable public UUID getOwner()
    • setOwner

      public void setOwner(@Nullable UUID p_32048_)
    • getThrower

      @Nullable public UUID getThrower()
    • setThrower

      public void setThrower(@Nullable UUID p_32053_)
    • getAge

      public int getAge()
    • setDefaultPickUpDelay

      public void setDefaultPickUpDelay()
    • setNoPickUpDelay

      public void setNoPickUpDelay()
    • setNeverPickUp

      public void setNeverPickUp()
    • setPickUpDelay

      public void setPickUpDelay(int p_32011_)
    • hasPickUpDelay

      public boolean hasPickUpDelay()
    • setUnlimitedLifetime

      public void setUnlimitedLifetime()
    • setExtendedLifetime

      public void setExtendedLifetime()
    • makeFakeItem

      public void makeFakeItem()
    • getSpin

      public float getSpin(float p_32009_)
    • getAddEntityPacket

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

      public ItemEntity copy()
    • getSoundSource

      public SoundSource getSoundSource()
      Overrides:
      getSoundSource in class Entity