A
Admincraft•4mo ago
gero

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
Admincraft Meta
Admincraft Meta•4mo ago
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
gero
geroOP•4mo ago
Bump 🙂
Dannyx
Dannyx•4mo ago
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)
gero
geroOP•4mo ago
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
Admincraft Meta
Admincraft Meta•4mo ago
An error has occurred!
DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:835:23)
at async _REST.request (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async ChatInputCommandInteraction.reply (/home/ubuntu/admincraft/admincraft-meta/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:114:5)
at async Object.execute (/home/ubuntu/admincraft/admincraft-meta/commands/close.js:90:17)
DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:835:23)
at async _REST.request (/home/ubuntu/admincraft/admincraft-meta/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async ChatInputCommandInteraction.reply (/home/ubuntu/admincraft/admincraft-meta/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:114:5)
at async Object.execute (/home/ubuntu/admincraft/admincraft-meta/commands/close.js:90:17)
This was most likely an error on our end. Please report this at the github
Admincraft Meta
Admincraft Meta•4mo ago
post closed!
The post/thread has been closed!
Requested by gold.ly#0

Did you find this page helpful?