Class ExperienceOrbEntity

java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.ExperienceOrbEntity
All Implemented Interfaces:
DataTracked, ScoreHolder, CommandOutput, Nameable, EntityLike

public class ExperienceOrbEntity extends Entity
Mappings:
Namespace Name
named net/minecraft/entity/ExperienceOrbEntity
intermediary net/minecraft/class_1303
official btg
  • Field Details

    • DESPAWN_AGE

      private static final int DESPAWN_AGE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DESPAWN_AGE Lnet/minecraft/entity/ExperienceOrbEntity;DESPAWN_AGE:I
      intermediary field_30055 Lnet/minecraft/class_1303;field_30055:I
      official b Lbtg;b:I
    • EXPENSIVE_UPDATE_INTERVAL

      private static final int EXPENSIVE_UPDATE_INTERVAL
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named EXPENSIVE_UPDATE_INTERVAL Lnet/minecraft/entity/ExperienceOrbEntity;EXPENSIVE_UPDATE_INTERVAL:I
      intermediary field_30056 Lnet/minecraft/class_1303;field_30056:I
      official c Lbtg;c:I
    • field_30057

      private static final int field_30057
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30057 Lnet/minecraft/entity/ExperienceOrbEntity;field_30057:I
      intermediary field_30057 Lnet/minecraft/class_1303;field_30057:I
      official d Lbtg;d:I
    • MERGING_CHANCE_FRACTION

      private static final int MERGING_CHANCE_FRACTION
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MERGING_CHANCE_FRACTION Lnet/minecraft/entity/ExperienceOrbEntity;MERGING_CHANCE_FRACTION:I
      intermediary field_30058 Lnet/minecraft/class_1303;field_30058:I
      official e Lbtg;e:I
    • field_30059

      private static final double field_30059
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30059 Lnet/minecraft/entity/ExperienceOrbEntity;field_30059:D
      intermediary field_30059 Lnet/minecraft/class_1303;field_30059:D
      official f Lbtg;f:D
    • orbAge

      private int orbAge
      Mappings:
      Namespace Name Mixin selector
      named orbAge Lnet/minecraft/entity/ExperienceOrbEntity;orbAge:I
      intermediary field_6164 Lnet/minecraft/class_1303;field_6164:I
      official g Lbtg;g:I
    • health

      private int health
      Mappings:
      Namespace Name Mixin selector
      named health Lnet/minecraft/entity/ExperienceOrbEntity;health:I
      intermediary field_6161 Lnet/minecraft/class_1303;field_6161:I
      official h Lbtg;h:I
    • amount

      private int amount
      Mappings:
      Namespace Name Mixin selector
      named amount Lnet/minecraft/entity/ExperienceOrbEntity;amount:I
      intermediary field_6159 Lnet/minecraft/class_1303;field_6159:I
      official i Lbtg;i:I
    • pickingCount

      private int pickingCount
      Mappings:
      Namespace Name Mixin selector
      named pickingCount Lnet/minecraft/entity/ExperienceOrbEntity;pickingCount:I
      intermediary field_27009 Lnet/minecraft/class_1303;field_27009:I
      official j Lbtg;j:I
    • target

      private PlayerEntity target
      Mappings:
      Namespace Name Mixin selector
      named target Lnet/minecraft/entity/ExperienceOrbEntity;target:Lnet/minecraft/entity/player/PlayerEntity;
      intermediary field_6162 Lnet/minecraft/class_1303;field_6162:Lnet/minecraft/class_1657;
      official k Lbtg;k:Lcmy;
  • Constructor Details

    • ExperienceOrbEntity

      public ExperienceOrbEntity(World world, double x, double y, double z, int amount)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/ExperienceOrbEntity;<init>(Lnet/minecraft/world/World;DDDI)V
      intermediary <init> Lnet/minecraft/class_1303;<init>(Lnet/minecraft/class_1937;DDDI)V
      official <init> Lbtg;<init>(Ldbz;DDDI)V
    • ExperienceOrbEntity

      public ExperienceOrbEntity(EntityType<? extends ExperienceOrbEntity> type, World world)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
      intermediary <init> Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
      official <init> Lbsv;<init>(Lbtb;Ldbz;)V
  • Method Details

    • getMoveEffect

      protected Entity.MoveEffect getMoveEffect()
      Returns the possible effect(s) of an entity moving.
      Overrides:
      getMoveEffect in class Entity
      Implementation Note:
      If an entity does not emit game events or play move sounds, this method should be overridden as returning a value other than ALL allows skipping some movement logic and boost ticking performance.
      Mappings:
      Namespace Name Mixin selector
      named getMoveEffect Lnet/minecraft/entity/Entity;getMoveEffect()Lnet/minecraft/entity/Entity$MoveEffect;
      intermediary method_33570 Lnet/minecraft/class_1297;method_33570()Lnet/minecraft/class_1297$class_5799;
      official bb Lbsv;bb()Lbsv$b;
    • initDataTracker

      protected void initDataTracker(DataTracker.Builder builder)
      Initializes data tracker.
      Specified by:
      initDataTracker in class Entity
      API Note:
      Subclasses should override this and add to the builder any data that needs to be tracked.
      Mappings:
      Namespace Name Mixin selector
      named initDataTracker Lnet/minecraft/entity/Entity;initDataTracker(Lnet/minecraft/entity/data/DataTracker$Builder;)V
      intermediary method_5693 Lnet/minecraft/class_1297;method_5693(Lnet/minecraft/class_2945$class_9222;)V
      official a Lbsv;a(Lako$a;)V
    • getGravity

      protected double getGravity()
      Overrides:
      getGravity in class Entity
      Mappings:
      Namespace Name Mixin selector
      named getGravity Lnet/minecraft/entity/Entity;getGravity()D
      intermediary method_7490 Lnet/minecraft/class_1297;method_7490()D
      official aY Lbsv;aY()D
    • tick

      public void tick()
      Ticks this entity.
      Overrides:
      tick in class Entity
      See Also:
      API Note:
      This can be overridden to add additional logics. super.tick(); should be called in those cases.
      Implementation Note:
      By default, this delegates all logics to Entity.baseTick().
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/entity/Entity;tick()V
      intermediary method_5773 Lnet/minecraft/class_1297;method_5773()V
      official l Lbsv;l()V
    • getVelocityAffectingPos

      protected BlockPos getVelocityAffectingPos()
      Overrides:
      getVelocityAffectingPos in class Entity
      Mappings:
      Namespace Name Mixin selector
      named getVelocityAffectingPos Lnet/minecraft/entity/Entity;getVelocityAffectingPos()Lnet/minecraft/util/math/BlockPos;
      intermediary method_23314 Lnet/minecraft/class_1297;method_23314()Lnet/minecraft/class_2338;
      official aK Lbsv;aK()Liz;
    • expensiveUpdate

      private void expensiveUpdate()
      Performs an expensive update.
      Implementation Requirements:
      Called every second (every EXPENSIVE_UPDATE_INTERVAL ticks). This method first checks if the orb still has a nearby target, and assigns a new target if there is none. It then tries to merge nearby experience orbs.
      Mappings:
      Namespace Name Mixin selector
      named expensiveUpdate Lnet/minecraft/entity/ExperienceOrbEntity;expensiveUpdate()V
      intermediary method_31498 Lnet/minecraft/class_1303;method_31498()V
      official u Lbtg;u()V
    • spawn

      public static void spawn(ServerWorld world, Vec3d pos, int amount)
      Mappings:
      Namespace Name Mixin selector
      named spawn Lnet/minecraft/entity/ExperienceOrbEntity;spawn(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;I)V
      intermediary method_31493 Lnet/minecraft/class_1303;method_31493(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;I)V
      official a Lbtg;a(Larf;Levs;I)V
    • wasMergedIntoExistingOrb

      private static boolean wasMergedIntoExistingOrb(ServerWorld world, Vec3d pos, int amount)
      Mappings:
      Namespace Name Mixin selector
      named wasMergedIntoExistingOrb Lnet/minecraft/entity/ExperienceOrbEntity;wasMergedIntoExistingOrb(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;I)Z
      intermediary method_31496 Lnet/minecraft/class_1303;method_31496(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;I)Z
      official b Lbtg;b(Larf;Levs;I)Z
    • isMergeable

      private boolean isMergeable(ExperienceOrbEntity other)
      Mappings:
      Namespace Name Mixin selector
      named isMergeable Lnet/minecraft/entity/ExperienceOrbEntity;isMergeable(Lnet/minecraft/entity/ExperienceOrbEntity;)Z
      intermediary method_31494 Lnet/minecraft/class_1303;method_31494(Lnet/minecraft/class_1303;)Z
      official a Lbtg;a(Lbtg;)Z
    • isMergeable

      private static boolean isMergeable(ExperienceOrbEntity orb, int seed, int amount)
      Mappings:
      Namespace Name Mixin selector
      named isMergeable Lnet/minecraft/entity/ExperienceOrbEntity;isMergeable(Lnet/minecraft/entity/ExperienceOrbEntity;II)Z
      intermediary method_31495 Lnet/minecraft/class_1303;method_31495(Lnet/minecraft/class_1303;II)Z
      official a Lbtg;a(Lbtg;II)Z
    • merge

      private void merge(ExperienceOrbEntity other)
      Mappings:
      Namespace Name Mixin selector
      named merge Lnet/minecraft/entity/ExperienceOrbEntity;merge(Lnet/minecraft/entity/ExperienceOrbEntity;)V
      intermediary method_31497 Lnet/minecraft/class_1303;method_31497(Lnet/minecraft/class_1303;)V
      official b Lbtg;b(Lbtg;)V
    • applyWaterMovement

      private void applyWaterMovement()
      Mappings:
      Namespace Name Mixin selector
      named applyWaterMovement Lnet/minecraft/entity/ExperienceOrbEntity;applyWaterMovement()V
      intermediary method_5921 Lnet/minecraft/class_1303;method_5921()V
      official v Lbtg;v()V
    • onSwimmingStart

      protected void onSwimmingStart()
      Overrides:
      onSwimmingStart in class Entity
      Mappings:
      Namespace Name Mixin selector
      named onSwimmingStart Lnet/minecraft/entity/Entity;onSwimmingStart()V
      intermediary method_5746 Lnet/minecraft/class_1297;method_5746()V
      official bn Lbsv;bn()V
    • damage

      public boolean damage(DamageSource source, float amount)
      Applies a damage to this entity. The exact implementation differs between subclasses.

      LivingEntity has health value, and damaging the entity decreases it. This also handles shields, extra damage to helmets for falling blocks, setting the attacker, playing hurt sound, etc.

      Some entities like ItemEntity also have health value, which the overridden method decrements. There also exist several entities, like EndCrystalEntity, where any damage discards the entity (perhaps with an explosion).

      If this is overridden, it must check the result of Entity.isInvulnerableTo(net.minecraft.entity.damage.DamageSource) and return early.

      Overrides:
      damage in class Entity
      Returns:
      whether the entity was actually damaged
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named damage Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z
      intermediary method_5643 Lnet/minecraft/class_1297;method_5643(Lnet/minecraft/class_1282;F)Z
      official a Lbsv;a(Lbro;F)Z
    • writeCustomDataToNbt

      public void writeCustomDataToNbt(NbtCompound nbt)
      Writes custom data to nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      Specified by:
      writeCustomDataToNbt in class Entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named writeCustomDataToNbt Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
      official b Lbsv;b(Lus;)V
    • readCustomDataFromNbt

      public void readCustomDataFromNbt(NbtCompound nbt)
      Reads custom data from nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Specified by:
      readCustomDataFromNbt in class Entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named readCustomDataFromNbt Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
      official a Lbsv;a(Lus;)V
    • onPlayerCollision

      public void onPlayerCollision(PlayerEntity player)
      Called when a player collides with the entity. Does nothing by default.

      This should be overridden if the collision logic is specific to players, such as picking up item entities, experience orbs, or arrows.

      Overrides:
      onPlayerCollision in class Entity
      Mappings:
      Namespace Name Mixin selector
      named onPlayerCollision Lnet/minecraft/entity/Entity;onPlayerCollision(Lnet/minecraft/entity/player/PlayerEntity;)V
      intermediary method_5694 Lnet/minecraft/class_1297;method_5694(Lnet/minecraft/class_1657;)V
      official b_ Lbsv;b_(Lcmy;)V
    • repairPlayerGears

      private int repairPlayerGears(PlayerEntity player, int amount)
      Repairs a player's gears using the experience recursively, until the experience is all used or all gears are repaired.
      Returns:
      the amount of leftover experience
      Mappings:
      Namespace Name Mixin selector
      named repairPlayerGears Lnet/minecraft/entity/ExperienceOrbEntity;repairPlayerGears(Lnet/minecraft/entity/player/PlayerEntity;I)I
      intermediary method_35051 Lnet/minecraft/class_1303;method_35051(Lnet/minecraft/class_1657;I)I
      official a Lbtg;a(Lcmy;I)I
    • getMendingRepairCost

      private int getMendingRepairCost(int repairAmount)
      Mappings:
      Namespace Name Mixin selector
      named getMendingRepairCost Lnet/minecraft/entity/ExperienceOrbEntity;getMendingRepairCost(I)I
      intermediary method_5922 Lnet/minecraft/class_1303;method_5922(I)I
      official c Lbtg;c(I)I
    • getMendingRepairAmount

      private int getMendingRepairAmount(int experienceAmount)
      Mappings:
      Namespace Name Mixin selector
      named getMendingRepairAmount Lnet/minecraft/entity/ExperienceOrbEntity;getMendingRepairAmount(I)I
      intermediary method_5917 Lnet/minecraft/class_1303;method_5917(I)I
      official d Lbtg;d(I)I
    • getExperienceAmount

      public int getExperienceAmount()
      Mappings:
      Namespace Name Mixin selector
      named getExperienceAmount Lnet/minecraft/entity/ExperienceOrbEntity;getExperienceAmount()I
      intermediary method_5919 Lnet/minecraft/class_1303;method_5919()I
      official p Lbtg;p()I
    • getOrbSize

      public int getOrbSize()
      Mappings:
      Namespace Name Mixin selector
      named getOrbSize Lnet/minecraft/entity/ExperienceOrbEntity;getOrbSize()I
      intermediary method_5920 Lnet/minecraft/class_1303;method_5920()I
      official s Lbtg;s()I
    • roundToOrbSize

      public static int roundToOrbSize(int value)
      Mappings:
      Namespace Name Mixin selector
      named roundToOrbSize Lnet/minecraft/entity/ExperienceOrbEntity;roundToOrbSize(I)I
      intermediary method_5918 Lnet/minecraft/class_1303;method_5918(I)I
      official b Lbtg;b(I)I
    • isAttackable

      public boolean isAttackable()
      Returns whether the entity can be attacked by players.

      Note that this is not called for most entities defined in vanilla as unattackable (such as ItemEntity and ExperienceOrbEntity) as trying to attack them kicks the player.

      Overrides:
      isAttackable in class Entity
      Returns:
      whether the entity can be attacked by players
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named isAttackable Lnet/minecraft/entity/Entity;isAttackable()Z
      intermediary method_5732 Lnet/minecraft/class_1297;method_5732()Z
      official ct Lbsv;ct()Z
    • createSpawnPacket

      public Packet<ClientPlayPacketListener> createSpawnPacket()
      Returns a packet to notify the clients of the entity's spawning.
      Overrides:
      createSpawnPacket in class Entity
      Returns:
      a packet to notify the clients of the entity's spawning
      API Note:
      Subclasses should return new EntitySpawnS2CPacket(this), unless they use a custom spawning packet.
      Mappings:
      Namespace Name Mixin selector
      named createSpawnPacket Lnet/minecraft/entity/Entity;createSpawnPacket()Lnet/minecraft/network/packet/Packet;
      intermediary method_18002 Lnet/minecraft/class_1297;method_18002()Lnet/minecraft/class_2596;
      official dl Lbsv;dl()Lzw;
    • getSoundCategory

      public SoundCategory getSoundCategory()
      Returns the sound category for sounds from this entity.

      This is used by Entity.playSound(SoundEvent, float, float) and defaults to SoundCategory.NEUTRAL. Hostile entities should override this to return SoundCategory.HOSTILE.

      Overrides:
      getSoundCategory in class Entity
      Returns:
      the sound category for sounds from this entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getSoundCategory Lnet/minecraft/entity/Entity;getSoundCategory()Lnet/minecraft/sound/SoundCategory;
      intermediary method_5634 Lnet/minecraft/class_1297;method_5634()Lnet/minecraft/class_3419;
      official de Lbsv;de()Lawb;