All Implemented Interfaces:
CommandSource, SyncedDataHolder, FlyingAnimal, Attackable, EquipmentUser, Leashable, NeutralMob, Targeting, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, INBTSerializable<CompoundTag>

public class Bee extends Animal implements NeutralMob, FlyingAnimal
  • Field Details

    • FLAP_DEGREES_PER_TICK

      public static final float FLAP_DEGREES_PER_TICK
      See Also:
    • TICKS_PER_FLAP

      public static final int TICKS_PER_FLAP
    • DATA_FLAGS_ID

      private static final EntityDataAccessor<Byte> DATA_FLAGS_ID
    • DATA_REMAINING_ANGER_TIME

      private static final EntityDataAccessor<Integer> DATA_REMAINING_ANGER_TIME
    • FLAG_ROLL

      private static final int FLAG_ROLL
      See Also:
    • FLAG_HAS_STUNG

      private static final int FLAG_HAS_STUNG
      See Also:
    • FLAG_HAS_NECTAR

      private static final int FLAG_HAS_NECTAR
      See Also:
    • STING_DEATH_COUNTDOWN

      private static final int STING_DEATH_COUNTDOWN
      See Also:
    • TICKS_BEFORE_GOING_TO_KNOWN_FLOWER

      private static final int TICKS_BEFORE_GOING_TO_KNOWN_FLOWER
      See Also:
    • TICKS_WITHOUT_NECTAR_BEFORE_GOING_HOME

      private static final int TICKS_WITHOUT_NECTAR_BEFORE_GOING_HOME
      See Also:
    • MIN_ATTACK_DIST

      private static final int MIN_ATTACK_DIST
      See Also:
    • MAX_CROPS_GROWABLE

      private static final int MAX_CROPS_GROWABLE
      See Also:
    • POISON_SECONDS_NORMAL

      private static final int POISON_SECONDS_NORMAL
      See Also:
    • POISON_SECONDS_HARD

      private static final int POISON_SECONDS_HARD
      See Also:
    • TOO_FAR_DISTANCE

      private static final int TOO_FAR_DISTANCE
      See Also:
    • HIVE_CLOSE_ENOUGH_DISTANCE

      private static final int HIVE_CLOSE_ENOUGH_DISTANCE
      See Also:
    • PATHFIND_TO_HIVE_WHEN_CLOSER_THAN

      private static final int PATHFIND_TO_HIVE_WHEN_CLOSER_THAN
      See Also:
    • HIVE_SEARCH_DISTANCE

      private static final int HIVE_SEARCH_DISTANCE
      See Also:
    • TAG_CROPS_GROWN_SINCE_POLLINATION

      public static final String TAG_CROPS_GROWN_SINCE_POLLINATION
      See Also:
    • TAG_CANNOT_ENTER_HIVE_TICKS

      public static final String TAG_CANNOT_ENTER_HIVE_TICKS
      See Also:
    • TAG_TICKS_SINCE_POLLINATION

      public static final String TAG_TICKS_SINCE_POLLINATION
      See Also:
    • TAG_HAS_STUNG

      public static final String TAG_HAS_STUNG
      See Also:
    • TAG_HAS_NECTAR

      public static final String TAG_HAS_NECTAR
      See Also:
    • TAG_FLOWER_POS

      public static final String TAG_FLOWER_POS
      See Also:
    • TAG_HIVE_POS

      public static final String TAG_HIVE_POS
      See Also:
    • PERSISTENT_ANGER_TIME

      private static final UniformInt PERSISTENT_ANGER_TIME
    • persistentAngerTarget

      @Nullable private UUID persistentAngerTarget
    • rollAmount

      private float rollAmount
    • rollAmountO

      private float rollAmountO
    • timeSinceSting

      private int timeSinceSting
    • ticksWithoutNectarSinceExitingHive

      int ticksWithoutNectarSinceExitingHive
    • stayOutOfHiveCountdown

      private int stayOutOfHiveCountdown
    • numCropsGrownSincePollination

      private int numCropsGrownSincePollination
    • COOLDOWN_BEFORE_LOCATING_NEW_HIVE

      private static final int COOLDOWN_BEFORE_LOCATING_NEW_HIVE
      See Also:
    • remainingCooldownBeforeLocatingNewHive

      int remainingCooldownBeforeLocatingNewHive
    • COOLDOWN_BEFORE_LOCATING_NEW_FLOWER

      private static final int COOLDOWN_BEFORE_LOCATING_NEW_FLOWER
      See Also:
    • remainingCooldownBeforeLocatingNewFlower

      int remainingCooldownBeforeLocatingNewFlower
    • savedFlowerPos

      @Nullable BlockPos savedFlowerPos
    • hivePos

      @Nullable BlockPos hivePos
    • beePollinateGoal

      Bee.BeePollinateGoal beePollinateGoal
    • goToHiveGoal

      Bee.BeeGoToHiveGoal goToHiveGoal
    • goToKnownFlowerGoal

      private Bee.BeeGoToKnownFlowerGoal goToKnownFlowerGoal
    • underWaterTicks

      private int underWaterTicks
  • Constructor Details

  • Method Details

    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder pBuilder)
      Overrides:
      defineSynchedData in class AgeableMob
    • getWalkTargetValue

      public float getWalkTargetValue(BlockPos pPos, LevelReader pLevel)
      Overrides:
      getWalkTargetValue in class Animal
    • registerGoals

      protected void registerGoals()
      Overrides:
      registerGoals in class Mob
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag pCompound)
      Overrides:
      addAdditionalSaveData in class Animal
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag pCompound)
      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
      readAdditionalSaveData in class Animal
    • doHurtTarget

      public boolean doHurtTarget(Entity pEntity)
      Overrides:
      doHurtTarget in class Mob
    • tick

      public void tick()
      Overrides:
      tick in class Mob
    • spawnFluidParticle

      private void spawnFluidParticle(Level pLevel, double pStartX, double pEndX, double pStartZ, double pEndZ, double pPosY, ParticleOptions pParticleOption)
    • pathfindRandomlyTowards

      void pathfindRandomlyTowards(BlockPos pPos)
    • getSavedFlowerPos

      @Nullable public BlockPos getSavedFlowerPos()
    • hasSavedFlowerPos

      public boolean hasSavedFlowerPos()
    • setSavedFlowerPos

      public void setSavedFlowerPos(BlockPos pSavedFlowerPos)
    • getTravellingTicks

      public int getTravellingTicks()
    • getBlacklistedHives

      public List<BlockPos> getBlacklistedHives()
    • isTiredOfLookingForNectar

      private boolean isTiredOfLookingForNectar()
    • wantsToEnterHive

      boolean wantsToEnterHive()
    • setStayOutOfHiveCountdown

      public void setStayOutOfHiveCountdown(int pStayOutOfHiveCountdown)
    • getRollAmount

      public float getRollAmount(float pPartialTick)
    • updateRollAmount

      private void updateRollAmount()
    • customServerAiStep

      protected void customServerAiStep()
      Overrides:
      customServerAiStep in class Animal
    • resetTicksWithoutNectarSinceExitingHive

      public void resetTicksWithoutNectarSinceExitingHive()
    • isHiveNearFire

      private boolean isHiveNearFire()
    • getRemainingPersistentAngerTime

      public int getRemainingPersistentAngerTime()
      Specified by:
      getRemainingPersistentAngerTime in interface NeutralMob
    • setRemainingPersistentAngerTime

      public void setRemainingPersistentAngerTime(int pTime)
      Specified by:
      setRemainingPersistentAngerTime in interface NeutralMob
    • getPersistentAngerTarget

      @Nullable public UUID getPersistentAngerTarget()
      Specified by:
      getPersistentAngerTarget in interface NeutralMob
    • setPersistentAngerTarget

      public void setPersistentAngerTarget(@Nullable UUID pTarget)
      Specified by:
      setPersistentAngerTarget in interface NeutralMob
    • startPersistentAngerTimer

      public void startPersistentAngerTimer()
      Specified by:
      startPersistentAngerTimer in interface NeutralMob
    • doesHiveHaveSpace

      private boolean doesHiveHaveSpace(BlockPos pHivePos)
    • hasHive

      public boolean hasHive()
    • getHivePos

      @Nullable public BlockPos getHivePos()
    • getGoalSelector

      public GoalSelector getGoalSelector()
    • sendDebugPackets

      protected void sendDebugPackets()
      Overrides:
      sendDebugPackets in class Mob
    • getCropsGrownSincePollination

      int getCropsGrownSincePollination()
    • resetNumCropsGrownSincePollination

      private void resetNumCropsGrownSincePollination()
    • incrementNumCropsGrownSincePollination

      void incrementNumCropsGrownSincePollination()
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class Animal
    • isHiveValid

      boolean isHiveValid()
    • hasNectar

      public boolean hasNectar()
    • setHasNectar

      void setHasNectar(boolean pHasNectar)
    • hasStung

      public boolean hasStung()
    • setHasStung

      private void setHasStung(boolean pHasStung)
    • isRolling

      private boolean isRolling()
    • setRolling

      private void setRolling(boolean pIsRolling)
    • isTooFarAway

      boolean isTooFarAway(BlockPos pPos)
    • setFlag

      private void setFlag(int pFlagId, boolean pValue)
    • getFlag

      private boolean getFlag(int pFlagId)
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • createNavigation

      protected PathNavigation createNavigation(Level pLevel)
      Overrides:
      createNavigation in class Mob
    • isFood

      public boolean isFood(ItemStack pStack)
      Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type)
      Specified by:
      isFood in class Animal
    • isFlowerValid

      boolean isFlowerValid(BlockPos pPos)
    • playStepSound

      protected void playStepSound(BlockPos pPos, BlockState pBlock)
      Overrides:
      playStepSound in class Entity
    • getAmbientSound

      protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class Mob
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource pDamageSource)
      Overrides:
      getHurtSound in class LivingEntity
    • getDeathSound

      protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class LivingEntity
    • getSoundVolume

      protected float getSoundVolume()
      Overrides:
      getSoundVolume in class LivingEntity
    • getBreedOffspring

      @Nullable public Bee getBreedOffspring(ServerLevel pLevel, AgeableMob pOtherParent)
      Specified by:
      getBreedOffspring in class AgeableMob
    • checkFallDamage

      protected void checkFallDamage(double pY, boolean pOnGround, BlockState pState, BlockPos pPos)
      Overrides:
      checkFallDamage in class LivingEntity
    • isFlapping

      public boolean isFlapping()
      Overrides:
      isFlapping in class Entity
    • isFlying

      public boolean isFlying()
      Specified by:
      isFlying in interface FlyingAnimal
    • dropOffNectar

      public void dropOffNectar()
    • hurt

      public boolean hurt(DamageSource pSource, float pAmount)
      Called when the entity is attacked.
      Overrides:
      hurt in class LivingEntity
    • jumpInLiquid

      @Deprecated protected void jumpInLiquid(TagKey<Fluid> pFluidTag)
      Deprecated.
      Overrides:
      jumpInLiquid in class Mob
    • jumpInLiquidInternal

      private void jumpInLiquidInternal()
    • jumpInFluid

      public void jumpInFluid(FluidType type)
      Description copied from interface: ILivingEntityExtension
      Performs what to do when an entity attempts to go up or "jump" in a fluid.
      Specified by:
      jumpInFluid in interface ILivingEntityExtension
      Overrides:
      jumpInFluid in class Mob
      Parameters:
      type - the type of the fluid
    • getLeashOffset

      public Vec3 getLeashOffset()
      Overrides:
      getLeashOffset in class Entity
    • closerThan

      boolean closerThan(BlockPos pPos, int pDistance)
    • setHivePos

      public void setHivePos(BlockPos pHivePos)