Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-186335

Bees age calculation inside hive/nest is broken

XMLWordPrintable

    • Confirmed
    • Mob behaviour
    • Important

      When a bee exits a hive/nest, its new age is calculated something like:

          new_age = old_age + TicksInHive * 20;
          if (new_age > 0){new_age = 0;}
      

      That makes bees grow 20 times faster than it should when are babies, and always set adult bees age (breeding cooldown) to 0.

       

      video: https://www.youtube.com/watch?v=73KonEmlZ9M

      20w22a code:

      It seems that ageUp() input has to be some sort of time in seconds rather than ticks to work properly, but just that doesn't solve the bug for adult bees.

       

      My fix proposal:

       

      Almost forgot: ticksInHive stops counting when reaches MinOccupationTicks (+1, because of a <= or something), so if bees stay longer than MinOccupationTicks inside the nest for any reason (night, rain), they wouldn't grow the amount they should. To fix this, ticksInHive has to keep increasing regardless of whether it surpasses MinOccupationTicks, or just stop it when equals the bee's Age (-Age when its a baby/negative age).

       

      Edit: seems it has been fixed already, great  I'm a bit worried with my suggestion about ticksInHive stop counting when equals the bee's Age. When the Age value is less than MinOccupationTicks this can lead to bees getting stuck inside its hive, because ticksInHive not reaching MinOccupationTicks. The real limit for ticksInHive should be:

      Math.max(MinOccupationTicks,Math.abs(old_Age))

       

       

      (its weird having an InLove timer and an Age timer when both are the same thing, positive Ages and negative Ages. Just forget about InLove timer)

       

        1. b1.PNG
          11 kB
          FACS01
        2. maybe fix.PNG
          27 kB
          FACS01

            cojomax99 [Mojang] Cory Scheviak
            FACS01 FACS01
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: