Animals can spawn randomly and by spawn egg. Some animals run when you attack them, some animal attack you back when you attack them. Most animals attack back like wild animals, farm animals usually run away except for bulls who sometimes attack you even when you didn't attack them but attack the cow (female). There are total of 31 animal but 34 egg (see also Spawn Eggs for more information for being more egg). Orca or killer whale is a rare animal it can't be spawn by eggs but it spawn randomly in ocean deeper than other. Horses and camels are special animals cause you can ride on them, but you need a saddle. Animal that attack players usually run when thy get too much damage. Also animal has a smart COM mind if you set a trap they can across it with a smart way!