Class ExperienceOrb

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

public class ExperienceOrb extends Entity
  • Field Details

    • LIFETIME

      private static final int LIFETIME
      See Also:
    • ENTITY_SCAN_PERIOD

      private static final int ENTITY_SCAN_PERIOD
      See Also:
    • MAX_FOLLOW_DIST

      private static final int MAX_FOLLOW_DIST
      See Also:
    • ORB_GROUPS_PER_AREA

      private static final int ORB_GROUPS_PER_AREA
      See Also:
    • ORB_MERGE_DISTANCE

      private static final double ORB_MERGE_DISTANCE
      See Also:
    • age

      private int age
    • health

      private int health
    • value

      public int value
    • count

      private int count
    • followingPlayer

      private Player followingPlayer
  • Constructor Details

    • ExperienceOrb

      public ExperienceOrb(Level p_20776_, double p_20777_, double p_20778_, double p_20779_, int p_20780_)
    • ExperienceOrb

      public ExperienceOrb(EntityType<? extends ExperienceOrb> p_20773_, Level p_20774_)
  • Method Details

    • 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
    • scanForEntities

      private void scanForEntities()
    • award

      public static void award(ServerLevel p_147083_, Vec3 p_147084_, int p_147085_)
    • tryMergeToExisting

      private static boolean tryMergeToExisting(ServerLevel p_147097_, Vec3 p_147098_, int p_147099_)
    • canMerge

      private boolean canMerge(ExperienceOrb p_147087_)
    • canMerge

      private static boolean canMerge(ExperienceOrb p_147089_, int p_147090_, int p_147091_)
    • merge

      private void merge(ExperienceOrb p_147101_)
    • setUnderwaterMovement

      private void setUnderwaterMovement()
    • doWaterSplashEffect

      protected void doWaterSplashEffect()
      Overrides:
      doWaterSplashEffect in class Entity
    • hurt

      public boolean hurt(DamageSource p_20785_, float p_20786_)
      Overrides:
      hurt in class Entity
    • addAdditionalSaveData

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

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

      public void playerTouch(Player p_20792_)
      Overrides:
      playerTouch in class Entity
    • repairPlayerItems

      private int repairPlayerItems(Player p_147093_, int p_147094_)
    • durabilityToXp

      private int durabilityToXp(int p_20794_)
    • xpToDurability

      private int xpToDurability(int p_20799_)
    • getValue

      public int getValue()
    • getIcon

      public int getIcon()
    • getExperienceValue

      public static int getExperienceValue(int p_20783_)
    • isAttackable

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

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

      public SoundSource getSoundSource()
      Overrides:
      getSoundSource in class Entity