The bug
Animals follow players holding flowers, even if they cannot see the player.
This is a very interesting mechanic and might be intended.
To reproduce
Build an enclosure for an animal with pressure plates on the floor
Connect the pressure plates to redstone lamps
Summon an animal, such as a sheep, a pig, or a bee inside of the enclosure, so that it should never be able to see the player
Hold an item to lure the animal, such as wheat, a carrot, or flowers, and walk around
→ ❌ The animal will always follow the player, even if it does not see it
What do redstone lamps have to do with this?
I don't understand.
EDIT: I see, it is to see if the animal moves