Class EnderDragonPart

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

public class EnderDragonPart extends Entity
Mappings:
Namespace Name
named net/minecraft/entity/boss/dragon/EnderDragonPart
intermediary net/minecraft/class_1508
official chm
  • Field Details

    • owner

      public final EnderDragonEntity owner
      Mappings:
      Namespace Name Mixin selector
      named owner Lnet/minecraft/entity/boss/dragon/EnderDragonPart;owner:Lnet/minecraft/entity/boss/dragon/EnderDragonEntity;
      intermediary field_7007 Lnet/minecraft/class_1508;field_7007:Lnet/minecraft/class_1510;
      official b Lchm;b:Lcho;
    • name

      public final String name
      Mappings:
      Namespace Name Mixin selector
      named name Lnet/minecraft/entity/boss/dragon/EnderDragonPart;name:Ljava/lang/String;
      intermediary field_7006 Lnet/minecraft/class_1508;field_7006:Ljava/lang/String;
      official c Lchm;c:Ljava/lang/String;
    • partDimensions

      private final EntityDimensions partDimensions
      Mappings:
      Namespace Name Mixin selector
      named partDimensions Lnet/minecraft/entity/boss/dragon/EnderDragonPart;partDimensions:Lnet/minecraft/entity/EntityDimensions;
      intermediary field_18119 Lnet/minecraft/class_1508;field_18119:Lnet/minecraft/class_4048;
      official d Lchm;d:Lbsk;
  • Constructor Details

    • EnderDragonPart

      public EnderDragonPart(EnderDragonEntity owner, String name, float width, float height)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/boss/dragon/EnderDragonPart;<init>(Lnet/minecraft/entity/boss/dragon/EnderDragonEntity;Ljava/lang/String;FF)V
      intermediary <init> Lnet/minecraft/class_1508;<init>(Lnet/minecraft/class_1510;Ljava/lang/String;FF)V
      official <init> Lchm;<init>(Lcho;Ljava/lang/String;FF)V
  • Method Details

    • 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 Lbsh;a(Lajt$a;)V
    • readCustomDataFromNbt

      protected 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 Lbsh;a(Ltx;)V
    • writeCustomDataToNbt

      protected 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 Lbsh;b(Ltx;)V
    • canHit

      public boolean canHit()
      Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.
      Overrides:
      canHit in class Entity
      Returns:
      whether the entity can be hit with a projectile or be targeted by the player crosshair
      Mappings:
      Namespace Name Mixin selector
      named canHit Lnet/minecraft/entity/Entity;canHit()Z
      intermediary method_5863 Lnet/minecraft/class_1297;method_5863()Z
      official bB Lbsh;bB()Z
    • getPickBlockStack

      @Nullable public @Nullable ItemStack getPickBlockStack()
      Returns the stack for creative "pick block" functionality, or null if there is none.

      If the entity has an item representation (such as boats or minecarts), this should be overridden to return a new stack. Note that MobEntity handles the spawn eggs. ItemFrameEntity instead returns the copy of the stack held in the frame.

      Overrides:
      getPickBlockStack in class Entity
      Returns:
      the stack for creative "pick block" functionality, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      named getPickBlockStack Lnet/minecraft/entity/Entity;getPickBlockStack()Lnet/minecraft/item/ItemStack;
      intermediary method_31480 Lnet/minecraft/class_1297;method_31480()Lnet/minecraft/class_1799;
      official dE Lbsh;dE()Lcud;
    • damage

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

      invalid reference
      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

      invalid reference
      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 Lbsh;a(Lbra;F)Z
    • isPartOf

      public boolean isPartOf(Entity entity)
      Returns whether this entity is part of entity.

      This is just an equality check for all entities except the ender dragon part. An ender dragon is composed of several entity parts; each part returns true for part.isPartOf(dragon).

      Overrides:
      isPartOf in class Entity
      Returns:
      whether this entity is part of entity
      Mappings:
      Namespace Name Mixin selector
      named isPartOf Lnet/minecraft/entity/Entity;isPartOf(Lnet/minecraft/entity/Entity;)Z
      intermediary method_5779 Lnet/minecraft/class_1297;method_5779(Lnet/minecraft/class_1297;)Z
      official t Lbsh;t(Lbsh;)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 dn Lbsh;dn()Lzb;
    • getDimensions

      public EntityDimensions getDimensions(EntityPose pose)
      Returns the dimensions of the entity with the given pose.
      Overrides:
      getDimensions in class Entity
      Returns:
      the dimensions of the entity with the given pose
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getDimensions Lnet/minecraft/entity/Entity;getDimensions(Lnet/minecraft/entity/EntityPose;)Lnet/minecraft/entity/EntityDimensions;
      intermediary method_18377 Lnet/minecraft/class_1297;method_18377(Lnet/minecraft/class_4050;)Lnet/minecraft/class_4048;
      official a Lbsh;a(Lbto;)Lbsk;
    • shouldSave

      public boolean shouldSave()
      Specified by:
      shouldSave in interface EntityLike
      Overrides:
      shouldSave in class Entity
      Mappings:
      Namespace Name Mixin selector
      named shouldSave Lnet/minecraft/world/entity/EntityLike;shouldSave()Z
      intermediary method_31746 Lnet/minecraft/class_5568;method_31746()Z
      official dP Ldwo;dP()Z