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

Sheep eat half as often as they did before 21w39a

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.2, 22w45a
    • None
    • Plausible
    • Mob behaviour
    • Normal
    • Platform

      I was experimenting with an automated wool farm where the limiting factor is the rate at which sheep eat grass to regrow wool, and found the rates were about half of what I had expected.

      Investigating, I found that when 21w39a started evaluating goals every other tick instead of every tick, the 1/1000 chance of adult sheep eating (and the 1/50 chance of baby sheep eating) was not adjusted with reducedTickDelay like it seems other chance-based goal activation was. The result is that sheep now eat only half as often as they did before 21w39a.

      The specific code in question is in net.minecraft.world.entity.ai.goal.EatBlockGoal:

          public boolean canUse() {
              if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) {
                  return false;
              }
      

      which has remained unchanged since 1.14.4 (I haven't checked earlier versions). I compare this to, for example, the chance for pandas to sneeze, which changed like this in 21w39a to maintain the previous chances:

                   if (!this.panda.isBaby() || !this.panda.canPerformAction()) {
                       return false;
                   }
      -            if (this.panda.isWeak() && this.panda.random.nextInt(500) == 1) {
      +            if (this.panda.isWeak() && this.panda.random.nextInt(PandaSneezeGoal.reducedTickDelay(500)) == 1) {
                       return true;
                   }
      -            return this.panda.random.nextInt(6000) == 1;
      +            return this.panda.random.nextInt(PandaSneezeGoal.reducedTickDelay(6000)) == 1;
               }
      

       

            Unassigned Unassigned
            anomie x Anomie X
            Votes:
            12 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: