Warden named by the name tag will never go dig back underground and despawn.
Attachments
Comments 6
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.
Likely intended, as nametagging mobs prevents natural despawning for all other mobs.