Have you ever tried to breed a good minecraft horse and thoght? Why cant i breed one faster then a elytra! Well animal genetics fixes that for you! Along with introducing real genetic math to pigs, sheep, cows, horses, striders, foxes, wolves, and more! Animal genetics makes it possible to selectivly breed animals to do whatever you desire.
The mechanics of animal genetics are simple enough, only the math for genetics is complex. First breed 2 animals, and make several babies, each of these babies will have the genes of the 2 parents mixed, if you only breed the babies that have the trait you desire, lets say speed, then you get the 2 fastest babies and make the next generation, then repeat until you have a pig faster then a jet!
Genomes
Well how many traits are controlled by genetics you may ask? There are 5 genomes in each animal, these genomes literally are there genetic data(admins can view the genetic data with a command). The speed genome, the strength genome, the health genome, the jump genome, and the visual genome.
Speed
Controls the speed of the mob, you can make a mob so slow it cant move, or a mob so fast its faster then a elytra.
Strength
Controls attack damage, size, and amount of drops a mob gives. It will even increase the number of eggs a chicken lays! If a mob has a enormous amount of strength, they will break leaves they walk into, even more strength, and they will break fences. It is to note that the min and max size a mob can have is 0.25x, and 2x respectively. The max drop multiplier is 4, min is 0. Multiplication of drops, and changes in size require the pekui mod.
Health
Controls mob health. Max of ~35, min of 1.
Jump
Only works for horses, this can control the jump hight, ranging from being incapable of jumping, to jumping 25 blocks.
Visual
Changes from mob to mob. For horses, it controls there color. For foxes, there colors. Rabbits, colors, and if they are a killer rabbit. Pandas, there personality. Etc. They also store the mutations.
Mutations
Whenever you breed 2 animals, they will mix the 2 parents traits, and randomly mutate parts of the genome. There are 5 genes on each genome that give exstreme positive, or negitive effects. Meaning, its only via mutations can you get exstreme values. Meaning, only thru breeding.(As when natrually spawned, they don't get mutations) However, for the visual genome, there is superpowers encoded into the 5 mutation genes.
Flight/No Fall Damage
Makes rideable mobs capable of flight when ridden, as well as making non-rideable and rideable mobs not take fall damage. Fight is slower when pekui is not installed. May not work if you are using the datapack before 1.19.4. However should not cause big issues.
Fire Resistance
They have permanent fire resistance.
Water Breathing
They have permanent water breathing.
Frost Walker
Permanent frost walker.
Regeneration
They have permanent regeneration.
Admin Control & Settings
This datapack also adds many settings to the op menu. If you are in creative mode, and have access to commands, you can use the op menu. Simply type "/trigger op_menu". If you hover over the settings in the menu they tell you what they do. There are all kinds of settings. From disabling the visual genome from effecting different mobs colors, to disabling special mutations. This allows you to balance the datapack to your own servers needs. As well as a few smaller tools like a command to view the genome of a nearby mob. Or reroll there genome.
Nerdy Technical Details
I first store the genetic information in the form of a scoreboard. 2 per trait i want to make genetic. EG: a speed male scoreboard, a speed female scoreboard. Then i use a binary to decimal converter to convert the base 10 number in the scoreboard into a list off 1's & 0's. Then combine the female and male scoreboard. EG: 9 male -> 01001, 8 female -> 01000. Then combined the speed gentic info is: 02001.
When the world starts, i have a random number generator that generates 31 diffrent 1's and 0's, then i combine them into a single base 10 number. The reason for 31, is that's the maximum binary number you can store in a scoreboard.
Honestly the visual apperences of the mobs were one of the harder fetures to do. If i want to be acurate i need specifc genes to have specific effects that interact with other genes effects. As thats how its done irl. Gene1,2,3 controls the darkness of the horse, 5,6,7 controls whether it has spots or not, etc. Basically the more chaotic you make the genes effects, the more the effects of the genes counter, or help each other, the more they intract, the more acurate it will be for the purposes of a block game.
When its time to read the genetic info, and use it to apply real effects, i turn the base 10 number into binary and for each digit, i apply a diffrent effect. Its important to note that the combined genetic info from both the female side, and male side is used, meaning 3 values, 0, 1, 2. If 0 in the first digit, add 0.1 speed. If 1 in the first digit, add -0.1 speed. If 2 in the first digit, add 0.5 speed.
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+