Wrong formula for pre-1.19.4 horse breeding?
Horse breeding got easier in 1.19.4 and when our server migrated from 1.18.2 to 1.21.1, we wrote a plugin to use the old formula (or so we thought).
When researching, the internet suggests the formula for pre-1.19.4 for the speed of a foal is
(Speed of parent 1 + Speed of parent 2 + random value between 0.1125 and 0.3375) / 3
. So we implemented it and thought everything is fine.
Some of our players noticed that they would get way more better horses than before, so we wrote a plugin that breeds horses from set-parents (horses with speed of 13 blocks per second, 0.308) automatically and collects the speed values of the foals.
The average speed was about 11.85 blocks per second (0.281) for 1.18.2 without any plugins and 1.21.1 with our plugin.
But the number of horses that have a speed of 13 blocks per second (0,308) or more was not at all similar: 1% for 1.18.2 without plugins and 13% for 1.21.1 with our plugin that applies the formula from above.
When calculating the probability for 13 blocks per second horses based on the formula, 13% makes sense. But that is not what vanilla 1.18.2 uses!
Is it the wrong formula? Are we forgetting something?6 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by gold.ly#0
Bump 🙂
Well, you could look at Minecraft's code to find the exact breeding formula in there (ofc use the 1.18.2 server jar for it)
I think I have no other choice. Thanks 🙂
This was easier than I thought hahah
Just in case someone will ever have the same issue, here is the real formula implemented in 1.18.2:
The base formula is correct (
(value of parent 1 + value of parent 2 + random value) / 3
, but the random value is generated in a very specific way.
Random value for speed: (0.44999998807907104 + (random double between 0 and 1) * 0,3 + (random double between 0 and 1) * 0,3 + (random double between 0 and 1) * 0,3) * 0,25
Random value for max health: 15 + (random integer between 0 and 7) + (random value between 0 and 8)
Random value for jump strength: 0.4000000059604645 + (random double between 0 and 1) * 0,2 + (random double between 0 and 1) * 0,2
An error has occurred!
This was most likely an error on our end. Please report this at the github
post closed!
The post/thread has been closed!
Requested by gold.ly#0