NPatsa

Make a mod that adds inheritable traits to minecraft mobs (for now, just cows, sheeps, pigs, chickens, and foxes) that influence height, native biome (cold, warm, temperate variants) speed, and rarer genes that influence aggressiveness, and disease. Make traits viewable using a syringe item

Kodari AI
KodariNov 11 at 8:17 pm 6
GeneticMobInheritance
Adds an inheritable genetics system to Minecraft mobs (cows, sheep, pigs, chickens, foxes). Mobs possess genes affecting height, native biome adaptation (cold/warm/temperate), movement speed, plus rare genes for aggressiveness and disease resistance. Traits pass from parents to offspring with Mendelian inheritance. Players use a syringe item to extract and view a mob's complete genetic profile, revealing dominant and recessive alleles. The mod integrates with Fabric API, spawning biome-appropriate variants naturally and enabling selective breeding gameplay.

I’ll add persistent inherited genes, apply their effects to the five animals, and make the syringe craftable for inspecting them.

Added inheritable height, speed, native-biome, aggression and disease-susceptibility traits to cows, sheep, pigs, chickens and foxes. Rare aggressive animals attack nearby players; disease-prone animals can periodically become ill.

Craft the reusable trait syringe with two iron ingots and a glass bottle placed diagonally, then use it on a supported animal to inspect its traits.

NPatsa

the mod is broken, it gets stuck on the "preparing for world creations" screen

Kodari AI
KodariNov 12 at 12:34 am 2

Moved gene initialization out of the entity-load callback, where biome lookups could stall chunk loading, and into the mob’s first tick.

If world creation still hangs, please share the latest game log so I can pinpoint the cause.

NPatsa

may I have an updated mod download

Kodari AI
KodariNov 12 at 12:35 am 1

To get the updated mod:

  1. Click Compile in the top bar. On phone, tap ⋮ → Compile Project.

  2. Click Compile in the window.

  3. When it succeeds, click Download on the build or Download .jar in the chat.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
15 312
src/main/java/com/mobgenes/MobGenes.java
package com.mobgenes;

import com.mojang.serialization.Codec;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.attachment.v1.AttachmentRegistry;
import net.fabricmc.fabric.api.attachment.v1.AttachmentType;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;

public class MobGenes implements ModInitializer {
    public static final AttachmentType<String> GENES = AttachmentRegistry.createPersistent(id("genes"), Codec.STRING);
    private static final ResourceKey<Item> SYRINGE_KEY = ResourceKey.create(Registries.ITEM, id("syringe"));
    public static final Item SYRINGE = Registry.register(BuiltInRegistries.ITEM, SYRINGE_KEY,
            new SyringeItem(new Item.Properties().setId(SYRINGE_KEY).stacksTo(1)));

    public static Identifier id(String path) {
        return Identifier.fromNamespaceAndPath("mobgenes", path);
    }

    @Override
    public void onInitialize() {
        CreativeModeTabEvents.modifyOutputEvent(CreativeModeTabs.TOOLS_AND_UTILITIES).register(output -> output.accept(SYRINGE));
    }
}