Class EnderDragonPart

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

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

    • owner

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

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

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

    • EnderDragonPart

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

    • initDataTracker

      protected void initDataTracker()
      Initializes data tracker.
      Specified by:
      initDataTracker in class Entity
      Mappings:
      Namespace Name Mixin selector
      official a_ Lbbn;a_()V
      intermediary method_5693 Lnet/minecraft/class_1297;method_5693()V
      named initDataTracker Lnet/minecraft/entity/Entity;initDataTracker()V
    • readCustomDataFromNbt

      protected void readCustomDataFromNbt(NbtCompound nbt)
      Reads custom data from nbt. Subclasses has 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
      official a Lbbn;a(Lpj;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
      named readCustomDataFromNbt Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • writeCustomDataToNbt

      protected void writeCustomDataToNbt(NbtCompound nbt)
      Writes custom data to nbt. Subclasses has 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
      official b Lbbn;b(Lpj;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
      named writeCustomDataToNbt Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)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
      official bk Lbbn;bk()Z
      intermediary method_5863 Lnet/minecraft/class_1297;method_5863()Z
      named canHit Lnet/minecraft/entity/Entity;canHit()Z
    • 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
      official a Lbbn;a(Lbaw;F)Z
      intermediary method_5643 Lnet/minecraft/class_1297;method_5643(Lnet/minecraft/class_1282;F)Z
      named damage Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;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
      official q Lbbn;q(Lbbn;)Z
      intermediary method_5779 Lnet/minecraft/class_1297;method_5779(Lnet/minecraft/class_1297;)Z
      named isPartOf Lnet/minecraft/entity/Entity;isPartOf(Lnet/minecraft/entity/Entity;)Z
    • createSpawnPacket

      public Packet<?> createSpawnPacket()
      Returns a packet to notify the clients of the entity's spawning.
      Specified by:
      createSpawnPacket in class Entity
      Returns:
      a packet to notify the clients of the entity's spawning
      Mappings:
      Namespace Name Mixin selector
      official S Lbbn;S()Ltc;
      intermediary method_18002 Lnet/minecraft/class_1297;method_18002()Lnet/minecraft/class_2596;
      named createSpawnPacket Lnet/minecraft/entity/Entity;createSpawnPacket()Lnet/minecraft/network/Packet;
    • 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
      official a Lbbn;a(Lbco;)Lbbo;
      intermediary method_18377 Lnet/minecraft/class_1297;method_18377(Lnet/minecraft/class_4050;)Lnet/minecraft/class_4048;
      named getDimensions Lnet/minecraft/entity/Entity;getDimensions(Lnet/minecraft/entity/EntityPose;)Lnet/minecraft/entity/EntityDimensions;
    • shouldSave

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