mojira.dev
MC-249294

Rabbits ignore the "MoreCarrotTicks" value, causing them to always try to eat carrots

When a rabbit pathfinds to a carrot block and consumes it, the MoreCarrotTicks value is set to 40 ticks.

It seems the intended behavior is that once until this value is 0 the rabbit will not be able to eat any carrots. However, because of a bug, the result is ignored.

Looking at Rabbit$RaidGardenGoal#canUse:

@Override
        public boolean canUse() {
            if (this.nextStartTick <= 0) {
                if (!this.rabbit.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
                    return false;
                }
                this.canRaid = false;
                this.wantsToRaid = this.rabbit.wantsMoreFood(); // If ticks == 0
                this.wantsToRaid = true;
            }            
            return super.canUse();
        }

The result of wantsMoreFood is ignored and overridden by true.

Comments 0

No comments.

Owen1212055

mattiasselin

Plausible

Low

Mob behaviour

1.18.2, 22w11a, 22w18a

22w42a

Retrieved