mojira.dev
MC-250252

Warden named by the name tag will never go dig back underground and despawn

Warden named by the name tag will never go dig back underground and despawn.

Attachments

Comments 6

Likely intended, as nametagging mobs prevents natural despawning for all other mobs.

In the snapshot 22w12a news it is explicitly mentioned that keep the warden from noticing you or getting angry for 60 seconds, it will dig back underground and despawn.

Code analysis (Mojang mappings, 22w15a): In Warden#tick():

...
            ...
            if (this.hasCustomName()) {
                WardenAi.setDigCooldown((LivingEntity)this);
            }
...

If the warden has a custom name, the minecraft:dig_cooldown memory in the warden Brain is reset to 1200, hence preventing it from digging down and despawning.

So the way this is coded doesn't let you spawn a warden without custom name that won't dig down, or a warden with custom name that would dig. Shouldn't there be a separate flag for it so you don't have to reset it's dig_cooldown every X ticks? rhetoric.

It should be based on PersistenceRequired not CustomName, honestly.

Do endermites also use PersistenceRequired to prevent themselves from despawning, since they too despawn on a timer rather than randomly?

[Mod]Les3awe

(Unassigned)

Confirmed

Mob behaviour

22w15a

Retrieved