Class GhastEntity

All Implemented Interfaces:
ComponentsAccess, Attackable, DataTracked, EquipmentHolder, Leashable, Monster, Targeter, ScoreHolder, Nameable, EntityLike, UniquelyIdentifiable, ServerWaypoint, Waypoint

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

    • SHOOTING

      private static final TrackedData<Boolean> SHOOTING
      Mappings:
      Namespace Name Mixin selector
      named SHOOTING Lnet/minecraft/entity/mob/GhastEntity;SHOOTING:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_7273 Lnet/minecraft/class_1571;field_7273:Lnet/minecraft/class_2940;
      official a Lcrp;a:Lalh;
    • DEFAULT_FIREBALL_STRENGTH

      private static final byte DEFAULT_FIREBALL_STRENGTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_FIREBALL_STRENGTH Lnet/minecraft/entity/mob/GhastEntity;DEFAULT_FIREBALL_STRENGTH:B
      intermediary field_57683 Lnet/minecraft/class_1571;field_57683:B
      official b Lcrp;b:B
    • fireballStrength

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

    • GhastEntity

      public GhastEntity(EntityType<? extends GhastEntity> 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> Lbzm;<init>(Lbzv;Ldmu;)V
  • Method Details

    • initGoals

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

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

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

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

      protected boolean isDisallowedInPeaceful()
      Overrides:
      isDisallowedInPeaceful in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named isDisallowedInPeaceful Lnet/minecraft/entity/mob/MobEntity;isDisallowedInPeaceful()Z
      intermediary method_23734 Lnet/minecraft/class_1308;method_23734()Z
      official ag Lcao;ag()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
      named isFireballFromPlayer Lnet/minecraft/entity/mob/GhastEntity;isFireballFromPlayer(Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_44320 Lnet/minecraft/class_1571;method_44320(Lnet/minecraft/class_1282;)Z
      official i Lcrp;i(Lbyb;)Z
    • isInvulnerableTo

      public boolean isInvulnerableTo(ServerWorld world, DamageSource source)
      Overrides:
      isInvulnerableTo in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named isInvulnerableTo Lnet/minecraft/entity/LivingEntity;isInvulnerableTo(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_5679 Lnet/minecraft/class_1309;method_5679(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;)Z
      official a Lcam;a(Laub;Lbyb;)Z
    • fall

      protected void fall(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition)
      Called when the entity falls. Flying mobs should override this to do nothing.
      Overrides:
      fall in class LivingEntity
      Implementation Note:
      If on ground, this calls Block.onLandedUpon(net.minecraft.world.World, net.minecraft.block.BlockState, net.minecraft.util.math.BlockPos, net.minecraft.entity.Entity, double), which can add or reduce fall damage, emits GameEvent.HIT_GROUND, then calls Entity.onLanding(). Otherwise, if heightDifference is negative, it subtracts that value from Entity.fallDistance.
      Mappings:
      Namespace Name Mixin selector
      named fall Lnet/minecraft/entity/Entity;fall(DZLnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)V
      intermediary method_5623 Lnet/minecraft/class_1297;method_5623(DZLnet/minecraft/class_2680;Lnet/minecraft/class_2338;)V
      official a Lbzm;a(DZLeeb;Ljb;)V
    • isClimbing

      public boolean isClimbing()
      Overrides:
      isClimbing in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named isClimbing Lnet/minecraft/entity/LivingEntity;isClimbing()Z
      intermediary method_6101 Lnet/minecraft/class_1309;method_6101()Z
      official eV Lcam;eV()Z
    • travel

      public void travel(Vec3d movementInput)
      Allows you to do certain speed and velocity calculations. This is useful for custom vehicle behavior, or custom entity movement. This is not to be confused with AI.

      See vanilla examples of custom horse vehicle and

      invalid reference
      flying entities
      .
      Overrides:
      travel in class LivingEntity
      Parameters:
      movementInput - represents the sidewaysSpeed, upwardSpeed, and forwardSpeed of the entity in that order
      Mappings:
      Namespace Name Mixin selector
      named travel Lnet/minecraft/entity/LivingEntity;travel(Lnet/minecraft/util/math/Vec3d;)V
      intermediary method_6091 Lnet/minecraft/class_1309;method_6091(Lnet/minecraft/class_243;)V
      official k Lcam;k(Lfis;)V
    • damage

      public boolean damage(ServerWorld world, 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 LivingEntity.isInvulnerableTo(net.minecraft.server.world.ServerWorld, 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
      named damage Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z
      intermediary method_64397 Lnet/minecraft/class_1297;method_64397(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;F)Z
      official a Lbzm;a(Laub;Lbyb;F)Z
    • initDataTracker

      protected void initDataTracker(DataTracker.Builder builder)
      Initializes data tracker.
      Overrides:
      initDataTracker in class MobEntity
      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 Lbzm;a(Lall$a;)V
    • createGhastAttributes

      public static DefaultAttributeContainer.Builder createGhastAttributes()
      Mappings:
      Namespace Name Mixin selector
      named createGhastAttributes Lnet/minecraft/entity/mob/GhastEntity;createGhastAttributes()Lnet/minecraft/entity/attribute/DefaultAttributeContainer$Builder;
      intermediary method_26913 Lnet/minecraft/class_1571;method_26913()Lnet/minecraft/class_5132$class_5133;
      official n Lcrp;n()Lcbr$a;
    • 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 do Lbzm;do()Laza;
    • getAmbientSound

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

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

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

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

      public static boolean canSpawn(EntityType<GhastEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random)
      Mappings:
      Namespace Name Mixin selector
      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
      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
      official b Lcrp;b(Lbzv;Ldmv;Lbzu;Ljb;Lbck;)Z
    • getLimitPerChunk

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

      protected void writeCustomData(WriteView view)
      Overrides:
      writeCustomData in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named writeCustomData Lnet/minecraft/entity/Entity;writeCustomData(Lnet/minecraft/storage/WriteView;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_11372;)V
      official a Lbzm;a(Lfdc;)V
    • readCustomData

      protected void readCustomData(ReadView view)
      Overrides:
      readCustomData in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named readCustomData Lnet/minecraft/entity/Entity;readCustomData(Lnet/minecraft/storage/ReadView;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_11368;)V
      official a Lbzm;a(Lfda;)V
    • hasQuadLeashAttachmentPoints

      public boolean hasQuadLeashAttachmentPoints()
      Overrides:
      hasQuadLeashAttachmentPoints in class Entity
      Mappings:
      Namespace Name Mixin selector
      named hasQuadLeashAttachmentPoints Lnet/minecraft/entity/Entity;hasQuadLeashAttachmentPoints()Z
      intermediary method_70986 Lnet/minecraft/class_1297;method_70986()Z
      official dL Lbzm;dL()Z
    • getElasticLeashDistance

      public double getElasticLeashDistance()
      Specified by:
      getElasticLeashDistance in interface Leashable
      Mappings:
      Namespace Name Mixin selector
      named getElasticLeashDistance Lnet/minecraft/entity/Leashable;getElasticLeashDistance()D
      intermediary method_70990 Lnet/minecraft/class_9817;method_70990()D
      official B Lcak;B()D
    • getLeashSnappingDistance

      public double getLeashSnappingDistance()
      Specified by:
      getLeashSnappingDistance in interface Leashable
      Mappings:
      Namespace Name Mixin selector
      named getLeashSnappingDistance Lnet/minecraft/entity/Leashable;getLeashSnappingDistance()D
      intermediary method_70989 Lnet/minecraft/class_9817;method_70989()D
      official A Lcak;A()D
    • updateYaw

      public static void updateYaw(MobEntity ghast)
      Mappings:
      Namespace Name Mixin selector
      named updateYaw Lnet/minecraft/entity/mob/GhastEntity;updateYaw(Lnet/minecraft/entity/mob/MobEntity;)V
      intermediary method_70719 Lnet/minecraft/class_1571;method_70719(Lnet/minecraft/class_1308;)V
      official a Lcrp;a(Lcao;)V