Class GhastEntity

All Implemented Interfaces:
Attackable, Monster, Targeter, CommandOutput, Nameable, EntityLike

public class GhastEntity extends FlyingEntity implements Monster
Mappings:
Namespace Name
official bvw
intermediary net/minecraft/class_1571
named net/minecraft/entity/mob/GhastEntity
  • Field Details

    • SHOOTING

      private static final TrackedData<Boolean> SHOOTING
      Mappings:
      Namespace Name Mixin selector
      official b Lbvw;b:Laby;
      intermediary field_7273 Lnet/minecraft/class_1571;field_7273:Lnet/minecraft/class_2940;
      named SHOOTING Lnet/minecraft/entity/mob/GhastEntity;SHOOTING:Lnet/minecraft/entity/data/TrackedData;
    • fireballStrength

      private int fireballStrength
      Mappings:
      Namespace Name Mixin selector
      official c Lbvw;c:I
      intermediary field_7272 Lnet/minecraft/class_1571;field_7272:I
      named fireballStrength Lnet/minecraft/entity/mob/GhastEntity;fireballStrength:I
  • Constructor Details

    • GhastEntity

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

    • initGoals

      protected void initGoals()
      Overrides:
      initGoals in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      official x Lbgb;x()V
      intermediary method_5959 Lnet/minecraft/class_1308;method_5959()V
      named initGoals Lnet/minecraft/entity/mob/MobEntity;initGoals()V
    • isShooting

      public boolean isShooting()
      Mappings:
      Namespace Name Mixin selector
      official q Lbvw;q()Z
      intermediary method_7050 Lnet/minecraft/class_1571;method_7050()Z
      named isShooting Lnet/minecraft/entity/mob/GhastEntity;isShooting()Z
    • setShooting

      public void setShooting(boolean shooting)
      Mappings:
      Namespace Name Mixin selector
      official w Lbvw;w(Z)V
      intermediary method_7048 Lnet/minecraft/class_1571;method_7048(Z)V
      named setShooting Lnet/minecraft/entity/mob/GhastEntity;setShooting(Z)V
    • getFireballStrength

      public int getFireballStrength()
      Mappings:
      Namespace Name Mixin selector
      official r Lbvw;r()I
      intermediary method_7049 Lnet/minecraft/class_1571;method_7049()I
      named getFireballStrength Lnet/minecraft/entity/mob/GhastEntity;getFireballStrength()I
    • isDisallowedInPeaceful

      protected boolean isDisallowedInPeaceful()
      Overrides:
      isDisallowedInPeaceful in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      official U Lbgb;U()Z
      intermediary method_23734 Lnet/minecraft/class_1308;method_23734()Z
      named isDisallowedInPeaceful Lnet/minecraft/entity/mob/MobEntity;isDisallowedInPeaceful()Z
    • isFireballFromPlayer

      private static boolean isFireballFromPlayer(DamageSource damageSource)
      Returns whether damageSource is caused by a player's fireball.

      This returns true for ghast fireballs reflected by a player, since the attacker is set as the player in that case.

      Returns:
      whether damageSource is caused by a player's fireball
      Mappings:
      Namespace Name Mixin selector
      official h Lbvw;h(Lben;)Z
      intermediary method_44320 Lnet/minecraft/class_1571;method_44320(Lnet/minecraft/class_1282;)Z
      named isFireballFromPlayer Lnet/minecraft/entity/mob/GhastEntity;isFireballFromPlayer(Lnet/minecraft/entity/damage/DamageSource;)Z
    • isInvulnerableTo

      public boolean isInvulnerableTo(DamageSource damageSource)
      Returns whether the entity is invulnerable to damageSource.

      This can be overridden to make the entity invulnerable to some damages, but super.isInvulnerableTo() should be called in this case.

      Overrides:
      isInvulnerableTo in class Entity
      Returns:
      whether the entity is invulnerable to damageSource
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lbfj;b(Lben;)Z
      intermediary method_5679 Lnet/minecraft/class_1297;method_5679(Lnet/minecraft/class_1282;)Z
      named isInvulnerableTo Lnet/minecraft/entity/Entity;isInvulnerableTo(Lnet/minecraft/entity/damage/DamageSource;)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 LivingEntity
      Returns:
      whether the entity was actually damaged
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lbfj;a(Lben;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
    • initDataTracker

      protected void initDataTracker()
      Initializes data tracker.
      Overrides:
      initDataTracker in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      official a_ Lbfj;a_()V
      intermediary method_5693 Lnet/minecraft/class_1297;method_5693()V
      named initDataTracker Lnet/minecraft/entity/Entity;initDataTracker()V
    • createGhastAttributes

      public static DefaultAttributeContainer.Builder createGhastAttributes()
      Mappings:
      Namespace Name Mixin selector
      official w Lbvw;w()Lbhf$a;
      intermediary method_26913 Lnet/minecraft/class_1571;method_26913()Lnet/minecraft/class_5132$class_5133;
      named createGhastAttributes Lnet/minecraft/entity/mob/GhastEntity;createGhastAttributes()Lnet/minecraft/entity/attribute/DefaultAttributeContainer$Builder;
    • 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
      official cY Lbfj;cY()Lami;
      intermediary method_5634 Lnet/minecraft/class_1297;method_5634()Lnet/minecraft/class_3419;
      named getSoundCategory Lnet/minecraft/entity/Entity;getSoundCategory()Lnet/minecraft/sound/SoundCategory;
    • getAmbientSound

      protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      official s Lbgb;s()Lamg;
      intermediary method_5994 Lnet/minecraft/class_1308;method_5994()Lnet/minecraft/class_3414;
      named getAmbientSound Lnet/minecraft/entity/mob/MobEntity;getAmbientSound()Lnet/minecraft/sound/SoundEvent;
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource source)
      Overrides:
      getHurtSound in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      official d Lbfz;d(Lben;)Lamg;
      intermediary method_6011 Lnet/minecraft/class_1309;method_6011(Lnet/minecraft/class_1282;)Lnet/minecraft/class_3414;
      named getHurtSound Lnet/minecraft/entity/LivingEntity;getHurtSound(Lnet/minecraft/entity/damage/DamageSource;)Lnet/minecraft/sound/SoundEvent;
    • getDeathSound

      protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      official g_ Lbfz;g_()Lamg;
      intermediary method_6002 Lnet/minecraft/class_1309;method_6002()Lnet/minecraft/class_3414;
      named getDeathSound Lnet/minecraft/entity/LivingEntity;getDeathSound()Lnet/minecraft/sound/SoundEvent;
    • getSoundVolume

      protected float getSoundVolume()
      Overrides:
      getSoundVolume in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      official eR Lbfz;eR()F
      intermediary method_6107 Lnet/minecraft/class_1309;method_6107()F
      named getSoundVolume Lnet/minecraft/entity/LivingEntity;getSoundVolume()F
    • canSpawn

      public static boolean canSpawn(EntityType<GhastEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random)
      Mappings:
      Namespace Name Mixin selector
      official b Lbvw;b(Lbfn;Lcmn;Lbgd;Lgu;Lapf;)Z
      intermediary method_20675 Lnet/minecraft/class_1571;method_20675(Lnet/minecraft/class_1299;Lnet/minecraft/class_1936;Lnet/minecraft/class_3730;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Z
      named canSpawn Lnet/minecraft/entity/mob/GhastEntity;canSpawn(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)Z
    • getLimitPerChunk

      public int getLimitPerChunk()
      Overrides:
      getLimitPerChunk in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      official fE Lbgb;fE()I
      intermediary method_5945 Lnet/minecraft/class_1308;method_5945()I
      named getLimitPerChunk Lnet/minecraft/entity/mob/MobEntity;getLimitPerChunk()I
    • writeCustomDataToNbt

      public 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.

      Overrides:
      writeCustomDataToNbt in class MobEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lbfj;b(Lqr;)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
    • readCustomDataFromNbt

      public 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.

      Overrides:
      readCustomDataFromNbt in class MobEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lbfj;a(Lqr;)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
    • getActiveEyeHeight

      protected float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
      Overrides:
      getActiveEyeHeight in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      official b Lbfz;b(Lbgl;Lbfk;)F
      intermediary method_18394 Lnet/minecraft/class_1309;method_18394(Lnet/minecraft/class_4050;Lnet/minecraft/class_4048;)F
      named getActiveEyeHeight Lnet/minecraft/entity/LivingEntity;getActiveEyeHeight(Lnet/minecraft/entity/EntityPose;Lnet/minecraft/entity/EntityDimensions;)F