Class MobEntity

All Implemented Interfaces:
ICommandSource, INameable, ICapabilityProvider, ICapabilitySerializable<CompoundNBT>, IForgeEntity, INBTSerializable<CompoundNBT>
Direct Known Subclasses:
AmbientEntity, CreatureEntity, EnderDragonEntity, FlyingEntity, SlimeEntity

public abstract class MobEntity extends LivingEntity
  • Field Details

    • DATA_MOB_FLAGS_ID

      private static final DataParameter<Byte> DATA_MOB_FLAGS_ID
    • ambientSoundTime

      public int ambientSoundTime
    • xpReward

      protected int xpReward
    • lookControl

      protected LookController lookControl
    • moveControl

      protected MovementController moveControl
    • jumpControl

      protected JumpController jumpControl
    • bodyRotationControl

      private final BodyController bodyRotationControl
    • goalSelector

      public final GoalSelector goalSelector
    • targetSelector

      public final GoalSelector targetSelector
    • target

      private LivingEntity target
    • sensing

      private final EntitySenses sensing
    • handItems

      private final NonNullList<ItemStack> handItems
    • handDropChances

      protected final float[] handDropChances
    • armorItems

      private final NonNullList<ItemStack> armorItems
    • armorDropChances

      protected final float[] armorDropChances
    • canPickUpLoot

      private boolean canPickUpLoot
    • persistenceRequired

      private boolean persistenceRequired
    • pathfindingMalus

      private final Map<PathNodeType,Float> pathfindingMalus
    • lootTable

      private ResourceLocation lootTable
    • lootTableSeed

      private long lootTableSeed
    • leashHolder

      @Nullable private Entity leashHolder
    • delayedLeashHolderId

      private int delayedLeashHolderId
    • leashInfoTag

      @Nullable private CompoundNBT leashInfoTag
    • restrictCenter

      private BlockPos restrictCenter
    • restrictRadius

      private float restrictRadius
  • Constructor Details

  • Method Details

    • registerGoals

      protected void registerGoals()
    • createMobAttributes

      public static AttributeModifierMap.MutableAttribute createMobAttributes()
    • createNavigation

      protected PathNavigator createNavigation(World p_175447_1_)
    • shouldPassengersInheritMalus

      protected boolean shouldPassengersInheritMalus()
    • getPathfindingMalus

      public float getPathfindingMalus(PathNodeType p_184643_1_)
    • setPathfindingMalus

      public void setPathfindingMalus(PathNodeType p_184644_1_, float p_184644_2_)
    • canCutCorner

      public boolean canCutCorner(PathNodeType p_233660_1_)
    • createBodyControl

      protected BodyController createBodyControl()
    • getLookControl

      public LookController getLookControl()
    • getMoveControl

      public MovementController getMoveControl()
    • getJumpControl

      public JumpController getJumpControl()
    • getNavigation

      public PathNavigator getNavigation()
    • getSensing

      public EntitySenses getSensing()
    • getTarget

      @Nullable public LivingEntity getTarget()
    • setTarget

      public void setTarget(@Nullable LivingEntity p_70624_1_)
    • canAttackType

      public boolean canAttackType(EntityType<?> p_213358_1_)
      Overrides:
      canAttackType in class LivingEntity
    • canFireProjectileWeapon

      public boolean canFireProjectileWeapon(ShootableItem p_230280_1_)
    • ate

      public void ate()
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class LivingEntity
    • getAmbientSoundInterval

      public int getAmbientSoundInterval()
    • playAmbientSound

      public void playAmbientSound()
    • baseTick

      public void baseTick()
      Overrides:
      baseTick in class LivingEntity
    • playHurtSound

      protected void playHurtSound(DamageSource p_184581_1_)
      Overrides:
      playHurtSound in class LivingEntity
    • resetAmbientSoundTime

      private void resetAmbientSoundTime()
    • getExperienceReward

      protected int getExperienceReward(PlayerEntity p_70693_1_)
      Overrides:
      getExperienceReward in class LivingEntity
    • spawnAnim

      public void spawnAnim()
    • handleEntityEvent

      public void handleEntityEvent(byte p_70103_1_)
      Overrides:
      handleEntityEvent in class LivingEntity
    • tick

      public void tick()
      Overrides:
      tick in class LivingEntity
    • updateControlFlags

      protected void updateControlFlags()
    • tickHeadTurn

      protected float tickHeadTurn(float p_110146_1_, float p_110146_2_)
      Overrides:
      tickHeadTurn in class LivingEntity
    • getAmbientSound

      @Nullable protected SoundEvent getAmbientSound()
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundNBT p_213281_1_)
      Overrides:
      addAdditionalSaveData in class LivingEntity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundNBT p_70037_1_)
      Overrides:
      readAdditionalSaveData in class LivingEntity
    • dropFromLootTable

      protected void dropFromLootTable(DamageSource p_213354_1_, boolean p_213354_2_)
      Overrides:
      dropFromLootTable in class LivingEntity
    • createLootContext

      protected LootContext.Builder createLootContext(boolean p_213363_1_, DamageSource p_213363_2_)
      Overrides:
      createLootContext in class LivingEntity
    • getLootTable

      public final ResourceLocation getLootTable()
      Overrides:
      getLootTable in class LivingEntity
    • getDefaultLootTable

      protected ResourceLocation getDefaultLootTable()
    • setZza

      public void setZza(float p_191989_1_)
    • setYya

      public void setYya(float p_70657_1_)
    • setXxa

      public void setXxa(float p_184646_1_)
    • setSpeed

      public void setSpeed(float p_70659_1_)
      Overrides:
      setSpeed in class LivingEntity
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class LivingEntity
    • pickUpItem

      protected void pickUpItem(ItemEntity p_175445_1_)
    • equipItemIfPossible

      public boolean equipItemIfPossible(ItemStack p_233665_1_)
    • setItemSlotAndDropWhenKilled

      protected void setItemSlotAndDropWhenKilled(EquipmentSlotType p_233657_1_, ItemStack p_233657_2_)
    • setGuaranteedDrop

      public void setGuaranteedDrop(EquipmentSlotType p_233663_1_)
    • canReplaceCurrentItem

      protected boolean canReplaceCurrentItem(ItemStack p_208003_1_, ItemStack p_208003_2_)
    • canReplaceEqualItem

      public boolean canReplaceEqualItem(ItemStack p_233659_1_, ItemStack p_233659_2_)
    • canHoldItem

      public boolean canHoldItem(ItemStack p_175448_1_)
    • wantsToPickUp

      public boolean wantsToPickUp(ItemStack p_230293_1_)
    • removeWhenFarAway

      public boolean removeWhenFarAway(double p_213397_1_)
    • requiresCustomPersistence

      public boolean requiresCustomPersistence()
    • shouldDespawnInPeaceful

      protected boolean shouldDespawnInPeaceful()
    • checkDespawn

      public void checkDespawn()
      Overrides:
      checkDespawn in class Entity
    • serverAiStep

      protected final void serverAiStep()
      Overrides:
      serverAiStep in class LivingEntity
    • sendDebugPackets

      protected void sendDebugPackets()
    • customServerAiStep

      protected void customServerAiStep()
    • getMaxHeadXRot

      public int getMaxHeadXRot()
    • getMaxHeadYRot

      public int getMaxHeadYRot()
    • getHeadRotSpeed

      public int getHeadRotSpeed()
    • lookAt

      public void lookAt(Entity p_70625_1_, float p_70625_2_, float p_70625_3_)
    • rotlerp

      private float rotlerp(float p_70663_1_, float p_70663_2_, float p_70663_3_)
    • checkMobSpawnRules

      public static boolean checkMobSpawnRules(EntityType<? extends MobEntity> p_223315_0_, IWorld p_223315_1_, SpawnReason p_223315_2_, BlockPos p_223315_3_, Random p_223315_4_)
    • checkSpawnRules

      public boolean checkSpawnRules(IWorld p_213380_1_, SpawnReason p_213380_2_)
    • checkSpawnObstruction

      public boolean checkSpawnObstruction(IWorldReader p_205019_1_)
    • getMaxSpawnClusterSize

      public int getMaxSpawnClusterSize()
    • isMaxGroupSizeReached

      public boolean isMaxGroupSizeReached(int p_204209_1_)
    • getMaxFallDistance

      public int getMaxFallDistance()
      Overrides:
      getMaxFallDistance in class Entity
    • getHandSlots

      public Iterable<ItemStack> getHandSlots()
      Overrides:
      getHandSlots in class Entity
    • getArmorSlots

      public Iterable<ItemStack> getArmorSlots()
      Specified by:
      getArmorSlots in class LivingEntity
    • getItemBySlot

      public ItemStack getItemBySlot(EquipmentSlotType p_184582_1_)
      Specified by:
      getItemBySlot in class LivingEntity
    • setItemSlot

      public void setItemSlot(EquipmentSlotType p_184201_1_, ItemStack p_184201_2_)
      Specified by:
      setItemSlot in class LivingEntity
    • dropCustomDeathLoot

      protected void dropCustomDeathLoot(DamageSource p_213333_1_, int p_213333_2_, boolean p_213333_3_)
      Overrides:
      dropCustomDeathLoot in class LivingEntity
    • getEquipmentDropChance

      protected float getEquipmentDropChance(EquipmentSlotType p_205712_1_)
    • populateDefaultEquipmentSlots

      protected void populateDefaultEquipmentSlots(DifficultyInstance p_180481_1_)
    • getEquipmentSlotForItem

      public static EquipmentSlotType getEquipmentSlotForItem(ItemStack p_184640_0_)
    • getEquipmentForSlot

      @Nullable public static Item getEquipmentForSlot(EquipmentSlotType p_184636_0_, int p_184636_1_)
    • populateDefaultEquipmentEnchantments

      protected void populateDefaultEquipmentEnchantments(DifficultyInstance p_180483_1_)
    • enchantSpawnedWeapon

      protected void enchantSpawnedWeapon(float p_241844_1_)
    • enchantSpawnedArmor

      protected void enchantSpawnedArmor(float p_242289_1_, EquipmentSlotType p_242289_2_)
    • finalizeSpawn

      @Nullable public ILivingEntityData finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, @Nullable ILivingEntityData p_213386_4_, @Nullable CompoundNBT p_213386_5_)
    • canBeControlledByRider

      public boolean canBeControlledByRider()
    • setPersistenceRequired

      public void setPersistenceRequired()
    • setDropChance

      public void setDropChance(EquipmentSlotType p_184642_1_, float p_184642_2_)
    • canPickUpLoot

      public boolean canPickUpLoot()
    • setCanPickUpLoot

      public void setCanPickUpLoot(boolean p_98053_1_)
    • canTakeItem

      public boolean canTakeItem(ItemStack p_213365_1_)
      Overrides:
      canTakeItem in class LivingEntity
    • isPersistenceRequired

      public boolean isPersistenceRequired()
    • interact

      public final ActionResultType interact(PlayerEntity p_184230_1_, Hand p_184230_2_)
      Overrides:
      interact in class Entity
    • checkAndHandleImportantInteractions

      private ActionResultType checkAndHandleImportantInteractions(PlayerEntity p_233661_1_, Hand p_233661_2_)
    • onOffspringSpawnedFromEgg

      protected void onOffspringSpawnedFromEgg(PlayerEntity p_213406_1_, MobEntity p_213406_2_)
    • mobInteract

      protected ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
    • isWithinRestriction

      public boolean isWithinRestriction()
    • isWithinRestriction

      public boolean isWithinRestriction(BlockPos p_213389_1_)
    • restrictTo

      public void restrictTo(BlockPos p_213390_1_, int p_213390_2_)
    • getRestrictCenter

      public BlockPos getRestrictCenter()
    • getRestrictRadius

      public float getRestrictRadius()
    • hasRestriction

      public boolean hasRestriction()
    • convertTo

      @Nullable public <T extends MobEntity> T convertTo(EntityType<T> p_233656_1_, boolean p_233656_2_)
    • tickLeash

      protected void tickLeash()
    • dropLeash

      public void dropLeash(boolean p_110160_1_, boolean p_110160_2_)
    • canBeLeashed

      public boolean canBeLeashed(PlayerEntity p_184652_1_)
    • isLeashed

      public boolean isLeashed()
    • getLeashHolder

      @Nullable public Entity getLeashHolder()
    • setLeashedTo

      public void setLeashedTo(Entity p_110162_1_, boolean p_110162_2_)
    • setDelayedLeashHolderId

      public void setDelayedLeashHolderId(int p_213381_1_)
    • startRiding

      public boolean startRiding(Entity p_184205_1_, boolean p_184205_2_)
      Overrides:
      startRiding in class Entity
    • restoreLeashFromSave

      private void restoreLeashFromSave()
    • setSlot

      public boolean setSlot(int p_174820_1_, ItemStack p_174820_2_)
      Overrides:
      setSlot in class Entity
    • isControlledByLocalInstance

      public boolean isControlledByLocalInstance()
      Overrides:
      isControlledByLocalInstance in class Entity
    • isValidSlotForItem

      public static boolean isValidSlotForItem(EquipmentSlotType p_184648_0_, ItemStack p_184648_1_)
    • isEffectiveAi

      public boolean isEffectiveAi()
      Overrides:
      isEffectiveAi in class LivingEntity
    • setNoAi

      public void setNoAi(boolean p_94061_1_)
    • setLeftHanded

      public void setLeftHanded(boolean p_184641_1_)
    • setAggressive

      public void setAggressive(boolean p_213395_1_)
    • isNoAi

      public boolean isNoAi()
    • isLeftHanded

      public boolean isLeftHanded()
    • isAggressive

      public boolean isAggressive()
    • setBaby

      public void setBaby(boolean p_82227_1_)
    • getMainArm

      public HandSide getMainArm()
      Specified by:
      getMainArm in class LivingEntity
    • canAttack

      public boolean canAttack(LivingEntity p_213336_1_)
      Overrides:
      canAttack in class LivingEntity
    • doHurtTarget

      public boolean doHurtTarget(Entity p_70652_1_)
      Overrides:
      doHurtTarget in class LivingEntity
    • maybeDisableShield

      private void maybeDisableShield(PlayerEntity p_233655_1_, ItemStack p_233655_2_, ItemStack p_233655_3_)
    • isSunBurnTick

      protected boolean isSunBurnTick()
    • jumpInLiquid

      protected void jumpInLiquid(ITag<Fluid> p_180466_1_)
      Overrides:
      jumpInLiquid in class LivingEntity
    • removeAfterChangingDimensions

      protected void removeAfterChangingDimensions()
      Overrides:
      removeAfterChangingDimensions in class Entity