Tutorials/Horses

This tutorial describes how to measure horse attributes and breed them.
==Measuring==
===Health===
The health can be determined by looking at the heads-up display (HUD.) The saddle icons replacing your hunger bar while riding a horse is the horse’s health bar. One heart equals two health points. When you ride a horse that has an odd number of health points, the last health point isn’t shown on the HUD. Sometimes, horses have an odd number of health points; one method you can check if the horse has an even or odd number of health points/hitpoints is by hitting the horse and mounting the horse to check the hitpoints. If the HUD shows one less health point lost in health than the attack damage to the player, after the player attacks it, either with or without tools, the horse has 1 more health point than shown in the HUD and thus has an odd number of health points. If the HUD shows the exact amount lost in health than the total attack damage to the player after the player attacks it, the horse has an even number of health and it has exactly the number of health points/hitpoints as shown in the HUD. The horse might regenerate one health point right after you attack it, so you might want to try again. Heal the horse to full health and attack it again to check again if you’re correct in checking if the horse has an odd or even number of hitpoints. For example, if a horse appears to have 22 hitpoints and you attack it, if the horse has lost one fewer health point than the damage you inflicted to the horse, and if the horse didn’t regenerate, then it means that the horse actually has 23 hitpoints.
===Jump Strength===
The internal value for jump strength for horses ranges from 0.4 to 1.0, which turns out to be approximately 1.11 to 5.3 blocks. A device to measure this can be quite simple: build walls of increasing heights parallel to each other, 3 blocks apart. To test horse jump strength, simply jump over the shortest wall to arrive at the next wall, and continue jumping until you can no longer jump. The last wall you were able to jump over indicates your horses maximum jump strength. Slabs and snow layers can be used to create non-full block increments.
Internal units	0.4 	0.5 	0.6 	0.7 	0.8 	0.9 	1.0 	player
blocks 	1.1093	1.6248	2.2216	2.8933	3.6339	4.4379	5.29997	1.2522
===Speed===
Speed proves to be the most difficult attribute to measure. The internal value for horses ranges from .1125 to .3375. A device to measure this can be constructed with the delay on repeaters, using repeater locking. Create a very long chain of repeaters. 
Use a piston to hold back the horse. Connect redstone such that the piston releases the horse at the same time as a pulse starts down the repeater chain. At the end of a certain amount of blocks (~45 or so), add pressure plates, which are usually more consistent than tripwire. When these pressure plates are activated, use a long string of redstone to lock every repeater in the chain. This will "freeze" the chain and the pulse that started at the beginning will be frozen in place. You can mark the repeater where the pulse is frozen with a block. 
Keep in mind that you may need repeaters to lengthen the signal enough to lock the entire repeater chain, which will introduce a delay. You can account for this delay by adjusting the delay of the repeaters used for locking. As long as all the repeaters lock at the exact same time, the device will work. 
Also keep in mind that for the results to be consistent, you must be going perfectly straight every time. You can do this by opening F3 mode and looking at the "facing" label, which shows a numerical value for your camera angle. You can temporarily decrease your mouse sensitivity through the controls to align yourself perfectly. 
This device cannot measure the horse's exact speed in blocks/second, but can accurately measure its speed relative to other horses. Aside from server lag, it is incredibly consistent and can be used for accurate comparisons.
To convert a horse's internal speed to blocks/second, multiply the internal value by 42.16. This differs from the usual conversion of 43.17 blocks/sec, because horses do not move at their full internal speed.
Internal units	0.1125 (min)	0.16875	0.2250 (avg)	0.28125	0.3375 (max)
blocks/s 	4.74 	7.11 	9.49 	11.86 	14.23
==Breeding difficulty==
In current versions of the game, breeding two horses creates a new horse by averaging the two parent horses and then adding random variance. As a result, unlike in older versions of the game, horse breeding is not biased to the average, so it is easier to breed horses with attributes farther away from the average. It is also therefore possible to breed the perfect horse.
Prior to Java Edition 1.19.4 and Bedrock Edition 1.19.70, breeding two horses created a new horse by averaging the two parent horses with a randomly generated horse. An average/arithmetic mean will always be less than the highest number being averaged, unless all numbers are identical. 
By this logic, a perfect horse can only be bred if the randomly selected horse is perfect, and both parent horses are perfect, in which case the average of the three perfect horses will be a perfect horse. By extension, without two perfect horses, a perfect horse cannot be bred. 
Attribute of both Parents	Attribute of both Parents	Attribute of both Parents	Chance of gettingbetter horse	Maximum child	Maximum child	Maximum child
Jump 	Health 	Speed 	Chance of gettingbetter horse	Jump 	Health 	Speed
0.40 (1.09m) 	 	0.1125 (4.86m/s) 	100% 	0.55 (2.22m) 	 	0.1875 (8.09m/s)
0.55 (1.91m) 	 	0.1686 (7.27m/s) 	75% 	0.70 (2.89m) 	 	0.2250 (9.71m/s)
0.70 (2.89m) 	 	0.2250 (9.71m/s) 	50% 	0.80 (3.63m) 	 	0.2625 (11.33m/s)
0.85 (4.02m) 	 	0.2813 (12.14m/s) 	25% 	0.90 (4.43m) 	 	0.3000 (12.95m/s)
1.00 (5.29m) 	 	0.3375 (14.57m/s) 	0% 	1.00 (5.29m) 	 	0.3375 (14.57m/s)
After 3.13 blocks jump, 11 hearts, or 9.71 blocks/second speed, any future breeding will have a higher chance of producing a worse child than a better one. Because the range of horses that are better than a given horse gets narrower as the horse gets better, the likelihood of breeding a horse in that range of better horses also gets linearly narrower as the horse gets better, and as a result, the actual number of breed attempts necessary to likely get a better horse increases hyperbolically, until a fully perfect horse is unattainable, as shown in the table.
This graph shows what jump strength a player should expect their best horse to have after repeatedly breeding their two best horses together up to 1,000 times. The blue line shows the average jump strength of the best horse and the chances of the horse's jump strength being within the red lines is 95%.
===Optimal Breeding Scheme===
The optimal breeding scheme is that you start with two parent horses and breed them, and if the foal is stronger than the weakest parent horse, replace the weakest parent horse with the foal. Each time a foal is produced counts as "1" breeding attempt, regardless of whether it replaces a parent or is discarded. 
This breeding scheme proves difficult to model mathematically because probabilities cascade with every attempt, so the following tables show consistent experimental data over 420,000 trials per table. If both parents have the attribute listed in the "Both parents," the following lists the number of foals produced before the target is reached). 
Note that since the maximum value is impossible to achieve via breeding, it is omitted. 
Target	Both parents	Both parents	Both parents	Both parents	Both parents	Both parents
Target	0.4 	0.5 	0.6 	0.7 	0.8 	0.9
0.5 	1 	— 	— 	— 	— 	—
0.6 	4 	2 	— 	— 	— 	—
0.7 	7 	6 	3 	— 	— 	—
0.8 	14 	13 	11 	7 	— 	—
0.9 	36 	34 	32 	29 	22 	—
0.95 	78 	77 	75 	71 	64 	44
0.99 	404 	403 	400 	394 	390 	368
Target	Both parents	Both parents	Both parents	Both parents	Both parents	Both parents
Target	15 	18 	21 	24 	27 	28
16 	1 	— 	— 	— 	— 	—
18 	2 	— 	— 	— 	— 	—
20 	3 	2 	— 	— 	— 	—
23 	8 	6 	3 	— 	— 	—
26 	20 	18 	15 	9 	— 	—
28 	46 	45 	42 	36 	19 	—
29 	100 	98 	95 	89 	73 	56
Target	Both parents	Both parents	Both parents	Both parents	Both parents	Both parents
Target	0.1125 	0.15 	0.2 	0.25 	0.3 	0.33
0.125 	1 	— 	— 	— 	— 	—
0.15 	1 	— 	— 	— 	— 	—
0.2 	4 	3 	— 	— 	— 	—
0.25 	11 	10 	7 	— 	— 	—
0.3 	36 	34 	31 	25 	— 	—
0.33 	207 	205 	203 	195 	173 	—
0.337 	2913 	2917 	2916 	2929 	2896 	2738
Category:Tutorials
de:Anleitungen/Pferdezucht
ja:チュートリアル/ウマ
zh:教程/马
pt:Tutoriais/Cavalos