All Implemented Interfaces:
CommandSource, FlyingAnimal, Attackable, 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()
      Overrides:
      defineSynchedData in class AgeableMob
    • getWalkTargetValue

      public float getWalkTargetValue(BlockPos p_27788_, LevelReader p_27789_)
      Overrides:
      getWalkTargetValue in class Animal
    • registerGoals

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

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

      public void readAdditionalSaveData(CompoundTag p_27793_)
      Overrides:
      readAdditionalSaveData in class Animal
    • doHurtTarget

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

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

      private void spawnFluidParticle(Level p_27780_, double p_27781_, double p_27782_, double p_27783_, double p_27784_, double p_27785_, ParticleOptions p_27786_)
    • pathfindRandomlyTowards

      void pathfindRandomlyTowards(BlockPos p_27881_)
    • getSavedFlowerPos

      @Nullable public BlockPos getSavedFlowerPos()
    • hasSavedFlowerPos

      public boolean hasSavedFlowerPos()
    • setSavedFlowerPos

      public void setSavedFlowerPos(BlockPos p_27877_)
    • getTravellingTicks

      public int getTravellingTicks()
    • getBlacklistedHives

      public List<BlockPos> getBlacklistedHives()
    • isTiredOfLookingForNectar

      private boolean isTiredOfLookingForNectar()
    • wantsToEnterHive

      boolean wantsToEnterHive()
    • setStayOutOfHiveCountdown

      public void setStayOutOfHiveCountdown(int p_27916_)
    • getRollAmount

      public float getRollAmount(float p_27936_)
    • 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 p_27795_)
      Specified by:
      setRemainingPersistentAngerTime in interface NeutralMob
    • getPersistentAngerTarget

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

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

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

      private boolean doesHiveHaveSpace(BlockPos p_27885_)
    • 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 p_27920_)
    • hasStung

      public boolean hasStung()
    • setHasStung

      private void setHasStung(boolean p_27926_)
    • isRolling

      private boolean isRolling()
    • setRolling

      private void setRolling(boolean p_27930_)
    • isTooFarAway

      boolean isTooFarAway(BlockPos p_27890_)
    • setFlag

      private void setFlag(int p_27833_, boolean p_27834_)
    • getFlag

      private boolean getFlag(int p_27922_)
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • createNavigation

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

      public boolean isFood(ItemStack p_27895_)
      Overrides:
      isFood in class Animal
    • isFlowerValid

      boolean isFlowerValid(BlockPos p_27897_)
    • playStepSound

      protected void playStepSound(BlockPos p_27820_, BlockState p_27821_)
      Overrides:
      playStepSound in class Entity
    • getAmbientSound

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

      protected SoundEvent getHurtSound(DamageSource p_27845_)
      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 p_148760_, AgeableMob p_148761_)
      Specified by:
      getBreedOffspring in class AgeableMob
    • getStandingEyeHeight

      protected float getStandingEyeHeight(Pose p_27804_, EntityDimensions p_27805_)
      Overrides:
      getStandingEyeHeight in class LivingEntity
    • checkFallDamage

      protected void checkFallDamage(double p_27754_, boolean p_27755_, BlockState p_27756_, BlockPos p_27757_)
      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 p_27762_, float p_27763_)
      Overrides:
      hurt in class Animal
    • getMobType

      public MobType getMobType()
      Overrides:
      getMobType in class LivingEntity
    • jumpInLiquid

      @Deprecated protected void jumpInLiquid(TagKey<Fluid> p_204061_)
      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 p_27817_, int p_27818_)