Class EntityXPOrb

All Implemented Interfaces:
Metadatable, Cloneable

public class EntityXPOrb extends Entity
Since:
2015/12/26
Author:
xtypr
  • Field Details

    • NETWORK_ID

      public static final int NETWORK_ID
      See Also:
    • ORB_SPLIT_SIZES

      public static final int[] ORB_SPLIT_SIZES
      Split sizes used for dropping experience orbs.
    • closestPlayer

      public Player closestPlayer
  • Constructor Details

  • Method Details

    • getNetworkId

      public int getNetworkId()
      Specified by:
      getNetworkId in class Entity
    • getWidth

      public float getWidth()
      Overrides:
      getWidth in class Entity
    • getLength

      public float getLength()
      Overrides:
      getLength in class Entity
    • getHeight

      public float getHeight()
      Overrides:
      getHeight in class Entity
    • getGravity

      protected float getGravity()
      Overrides:
      getGravity in class Entity
    • getDrag

      protected float getDrag()
      Overrides:
      getDrag in class Entity
    • canCollide

      public boolean canCollide()
      Overrides:
      canCollide in class Entity
    • initEntity

      protected void initEntity()
      Overrides:
      initEntity in class Entity
    • attack

      public boolean attack(EntityDamageEvent source)
      Overrides:
      attack in class Entity
    • onUpdate

      public boolean onUpdate(int currentTick)
      Overrides:
      onUpdate in class Entity
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class Entity
    • getExp

      public int getExp()
    • setExp

      public void setExp(int exp)
    • canCollideWith

      public boolean canCollideWith(Entity entity)
      Overrides:
      canCollideWith in class Entity
    • getPickupDelay

      public int getPickupDelay()
    • setPickupDelay

      public void setPickupDelay(int pickupDelay)
    • getMaxOrbSize

      public static int getMaxOrbSize(int amount)
      Returns the largest size of normal XP orb that will be spawned for the specified amount of XP. Used to split XP up into multiple orbs when an amount of XP is dropped.
    • splitIntoOrbSizes

      public static List<Integer> splitIntoOrbSizes(int amount)
      Splits the specified amount of XP into an array of acceptable XP orb sizes.
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      Description copied from class: Entity
      The name that English name of the type of this entity.
      Overrides:
      getOriginalName in class Entity