mojira.dev
MC-306004

Golden dandelions also reset baby mobs' age besides freezing it

The Golden Dandelion is a new type of flower that can be used to stop baby mobs from aging. However, its current behavior resets the age of an affected mob instead of freezing the age tick timer, resulting in baby mobs taking their full time to grow into adults instead of the time since the Golden Dandelion was used on them.

Expected result:

Feeding a baby mob a Golden Dandelion should stop its negaitve age counter from ticking up from the value it was fed.

Actual result:

Feeding a baby mob a Golden Dandelion resets its age to its lowest possible value and stops it from ticking up.

Attachments

Comments 5

Thank you for helping us improve Minecraft! We saved your files:

[media]

This behavior also occurs when summoning a mob via commands with an age lower than the default for baby mobs:

This behavior stems from its implementation found in the mobInteract method within AgeableMob.class

protected InteractionResult mobInteract(final Player player, final InteractionHand hand) {
        ItemStack itemInHand = player.getItemInHand(hand);
        if (itemInHand.getItem() == Items.GOLDEN_DANDELION && this.isBaby() && this.ageLockParticleTimer == 0 && !this.is(EntityTypeTags.CANNOT_BE_AGE_LOCKED)) {
            this.setAgeLocked(!this.isAgeLocked());
            this.setAge(-24000);
            this.ageLockParticleTimer = 40;
            itemInHand.consume(1, player);
            this.level().playSound((Entity)null, this.blockPosition(), this.isAgeLocked() ? SoundEvents.GOLDEN_DANDELION_USE : SoundEvents.GOLDEN_DANDELION_UNUSE, SoundSource.PLAYERS, 1.0F, 1.0F);
            return InteractionResult.SUCCESS;
        } else {
            return super.mobInteract(player, hand);
        }
    }

In the code, this.setAge(-24000) is explicitly called.

Can confirm for 26.1-snapshot-5

Thank you for your report!
However, this issue is Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version History -- Snapshot Version History -- Feature Requests and Suggestions

Quick Links:
📓 Bug Tracker Guidelines -- 💬 Community Support -- 📧 Mojang Support (Technical Issues) -- 📧 Microsoft Support (Account Issues) -- 📓 Project Summary -- ✍️ Feedback and Suggestions -- 📖 Game Wiki

phizlip

(Unassigned)

1553274

Confirmed

Expansion A

(Unassigned)

26.1 Snapshot 5

Retrieved