Baby Mobs Visual Cue

Be able to tell if a baby mob is aged locked just by holding a golden dandelion!

Supported Versions:

26.1

Commands by Row:

Row 1

1. [impulse] /team add baby baby
2. [chain] /team modify baby color yellow

Row 2

3. [repeat] /execute as @a[nbt={SelectedItem:{id:"minecraft:golden_dandelion"}}] at @s if entity @e[nbt={AgeLocked:1b},distance=..5] run team join baby @e[nbt={AgeLocked:1b},distance=..5]
4. [chain] /execute as @a[nbt={SelectedItem:{id:"minecraft:golden_dandelion"}}] at @s if entity @e[nbt={AgeLocked:1b},distance=..5] run effect give @e[nbt={AgeLocked:1b},distance=..5] minecraft:glowing 1 1 true
5. [chain] /execute as @e[team=baby] unless entity @s[nbt={AgeLocked:1b}] run team leave @s
6. [chain] /execute as @a[nbt={SelectedItem:{id:"minecraft:golden_dandelion"}}] at @s if entity @e[nbt={AgeLocked:0b},distance=..5] run effect clear @e[nbt={AgeLocked:0b},distance=..5] minecraft:glowing

Preview

impulse
chain
repeat
chain
chain
chain

Video

Too lazy to copy and paste each command?