Class ItemEntity

java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.ItemEntity
All Implemented Interfaces:
CommandOutput, Nameable

public class ItemEntity
extends Entity
  • Field Details

    • STACK

      private static final TrackedData<ItemStack> STACK
    • age

      private int age
    • pickupDelay

      private int pickupDelay
    • health

      private int health
    • thrower

      private UUID thrower
    • owner

      private UUID owner
    • hoverHeight

      public final float hoverHeight
  • Constructor Details

    • ItemEntity

      public ItemEntity​(EntityType<? extends ItemEntity> type, World world)
    • ItemEntity

      public ItemEntity​(World world, double x, double y, double z)
    • ItemEntity

      public ItemEntity​(World world, double x, double y, double z, ItemStack stack)
    • ItemEntity

      @Environment(CLIENT) private ItemEntity​(ItemEntity itemEntity)
  • Method Details

    • canClimb

      protected boolean canClimb()
      Overrides:
      canClimb in class Entity
    • initDataTracker

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

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

      private void applyBuoyancy()
    • method_24348

      private void method_24348()
    • tryMerge

      private void tryMerge()
    • canMerge

      private boolean canMerge()
    • tryMerge

      private void tryMerge​(ItemEntity other)
    • canMerge

      public static boolean canMerge​(ItemStack stack1, ItemStack stack2)
    • merge

      public static ItemStack merge​(ItemStack stack1, ItemStack stack2, int maxCount)
    • merge

      private static void merge​(ItemEntity targetEntity, ItemStack stack1, ItemStack stack2)
    • merge

      private static void merge​(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack)
    • isFireImmune

      public boolean isFireImmune()
      Overrides:
      isFireImmune in class Entity
    • damage

      public boolean damage​(DamageSource source, float amount)
      Overrides:
      damage in class Entity
    • writeCustomDataToTag

      public void writeCustomDataToTag​(CompoundTag tag)
      Specified by:
      writeCustomDataToTag in class Entity
    • readCustomDataFromTag

      public void readCustomDataFromTag​(CompoundTag tag)
      Specified by:
      readCustomDataFromTag in class Entity
    • onPlayerCollision

      public void onPlayerCollision​(PlayerEntity player)
      Overrides:
      onPlayerCollision in class Entity
    • getName

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

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

      @Nullable public Entity moveToWorld​(ServerWorld destination)
      Moves this entity to another world.

      Note all entities except server player entities are completely recreated at the destination.

      Overrides:
      moveToWorld in class Entity
      Returns:
      the entity in the other world
    • getStack

      public ItemStack getStack()
    • setStack

      public void setStack​(ItemStack stack)
    • onTrackedDataSet

      public void onTrackedDataSet​(TrackedData<?> data)
      Overrides:
      onTrackedDataSet in class Entity
    • getOwner

      @Nullable public UUID getOwner()
    • setOwner

      public void setOwner​(@Nullable UUID uuid)
    • getThrower

      @Nullable public UUID getThrower()
    • setThrower

      public void setThrower​(@Nullable UUID uuid)
    • getAge

      @Environment(CLIENT) public int getAge()
    • setToDefaultPickupDelay

      public void setToDefaultPickupDelay()
    • resetPickupDelay

      public void resetPickupDelay()
    • setPickupDelayInfinite

      public void setPickupDelayInfinite()
    • setPickupDelay

      public void setPickupDelay​(int pickupDelay)
    • cannotPickup

      public boolean cannotPickup()
    • setCovetedItem

      public void setCovetedItem()
    • setDespawnImmediately

      public void setDespawnImmediately()
    • method_27314

      @Environment(CLIENT) public float method_27314​(float float2)
    • createSpawnPacket

      public Packet<?> createSpawnPacket()
      Specified by:
      createSpawnPacket in class Entity
    • method_29271

      @Environment(CLIENT) public ItemEntity method_29271()