Oreo YT

Create a chaotic new animal ecosystem in Minecraft with the Hybrid Animals Mod! Every animal mob can breed with any other animal using a Golden Apple, creating unique hybrids that combine the traits, appearance, behaviors, abilities, drops, and mechanics of both parents. Animals will approach the player when they are holding a Golden Apple, and by right-clicking two different animals, the player can feed them and create a brand-new hybrid. Each hybrid inherits mechanics from both parents; for example, a Cow and Sheep hybrid can be milked like a Cow and sheared like a Sheep, while other hybrids can combine special abilities, drops, movement styles, AI behaviors, sounds, and interactions from their parents (Other animals). Create endless combinations such as Pig + Bee, Wolf + Chicken, Horse + Frog, Cow + Sheep, and countless other bizarre animal combinations. With an effectively unlimited number of possible hybrids, breeding, survival, exploration, and animal collecting become more creative, unpredictable, chaotic, and fun than ever before!

Kodari AI
KodariOct 6 at 6:01 pm 1
HybridAnimalBreeding
Introduces a chaotic animal breeding system where any two animal mobs can be bred using a Golden Apple to create unique hybrids. Animals approach players holding Golden Apples, and right-clicking two different animals feeds them and spawns a hybrid combining traits, appearance, behaviors, abilities, drops, and mechanics from both parents. Hybrids inherit interactive mechanics like milking, shearing, and special abilities, enabling endless combinations such as Cow-Sheep, Pig-Bee, and Wolf-Chicken. The plugin enhances breeding, survival, exploration, and animal collecting with unpredictable, creative, and fun outcomes.

[Generation stopped]

Oreo YT

Create a chaotic new animal ecosystem in Minecraft with the Hybrid Animals Mod! Every animal mob can breed with any other animal using a Golden Apple, creating unique hybrids that combine the traits, appearance, behaviors, abilities, drops, and mechanics of both parents. Animals will approach the player when they are holding a Golden Apple, and by right-clicking two different animals, the player can feed them and create a brand-new hybrid. Each hybrid inherits mechanics from both parents; for example, a Cow and Sheep hybrid can be milked like a Cow and sheared like a Sheep, while other hybrids can combine special abilities, drops, movement styles, AI behaviors, sounds, and interactions from their parents (Other animals). Create endless combinations such as Pig + Bee, Wolf + Chicken, Horse + Frog, Cow + Sheep, and countless other bizarre animal combinations. With an effectively unlimited number of possible hybrids, breeding, survival, exploration, and animal collecting become more creative, unpredictable, chaotic, and fun than ever before! (Minecraft mod jar file for 1.21.11)

Kodari AI
KodariOct 6 at 6:01 pm 1

The generation was stopped before any content could be produced.

Oreo YT

Create a chaotic new animal ecosystem in Minecraft with the Hybrid Animals Mod! Every animal mob can breed with any other animal using a Golden Apple, creating unique hybrids that combine the traits, appearance, behaviors, abilities, drops, and mechanics of both parents. Animals will approach the player when they are holding a Golden Apple, and by right-clicking two different animals, the player can feed them and create a brand-new hybrid. Each hybrid inherits mechanics from both parents; for example, a Cow and Sheep hybrid can be milked like a Cow and sheared like a Sheep, while other hybrids can combine special abilities, drops, movement styles, AI behaviors, sounds, and interactions from their parents (Other animals). Create endless combinations such as Pig + Bee, Wolf + Chicken, Horse + Frog, Cow + Sheep, and countless other bizarre animal combinations. With an effectively unlimited number of possible hybrids, breeding, survival, exploration, and animal collecting become more creative, unpredictable, chaotic, and fun than ever before! (Minecraft mod jar file for 1.21.11 Fabric)

Kodari AI
KodariOct 6 at 6:04 pm 1

[Generation stopped]

Oreo YT

1.21.11

Kodari AI
KodariOct 6 at 6:14 pm 5
  1. Scaffold a Fabric mod targeting Minecraft 1.21.11.

  2. Implement golden-apple attraction, cross-species hybrid breeding, and inherited Cow/Sheep interactions.

  3. Add hybrid lineage persistence and mod metadata.

Created a Fabric mod project targeting Minecraft 1.21.11. Animals approach players holding Golden Apples; feeding two different animals creates a baby hybrid with persistent inherited lineage. Hybrids with Cow ancestry can be milked, and those with Sheep ancestry can be sheared; wool regrows over time.

Hybrid visuals, sounds, AI, and ordinary drops come from one randomly selected parent mob. The mod records both parents’ lineages, but it does not yet blend arbitrary models or combine every animal’s abilities and drops.

To get the mod jar, click Compile in the desktop top bar (or ⋮ → Compile Project on phone), then click Compile in the window. When it succeeds, use Download on the build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 303
src/main/java/com/kodari/hybridanimals/HybridAnimals.java
package com.kodari.hybridanimals;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;

import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

public class HybridAnimals implements ModInitializer {
    private static final String HYBRID_TAG = "hybridanimals:hybrid";
    private static final String GENE_PREFIX = "hybridanimals:gene:";
    private static final String SHEARED_UNTIL_PREFIX = "hybridanimals:sheared_until:";
    private static final long WOOL_REGROW_TICKS = 12000L;
    private static final double APPROACH_RANGE = 12.0;
    private static final Map<UUID, UUID> PENDING_PARENT = new HashMap<>();

    @Override
    public void onInitialize() {
        UseEntityCallback.EVENT.register(this::onAnimalInteraction);
        ServerTickEvents.END_WORLD_TICK.register(this::attractAnimals);
    }

    private ActionResult onAnimalInteraction(PlayerEntity player, World world, Hand hand, Entity target,
                                             net.minecraft.util.hit.EntityHitResult hitResult) {
        if (!(target instanceof AnimalEntity animal)) {
            return ActionResult.PASS;
        }

        ItemStack held = player.getStackInHand(hand);
        if (isHybrid(animal) && held.isOf(Items.BUCKET) && hasGene(animal, "minecraft:cow")) {
            if (!world.isClient && player instanceof ServerPlayerEntity serverPlayer) {
                milkHybrid(serverPlayer, hand);
            }
            return ActionResult.SUCCESS;
        }

        if (isHybrid(animal) && held.isOf(Items.SHEARS) && hasGene(animal, "minecraft:sheep")) {
            if (!world.isClient && world instanceof ServerWorld serverWorld) {
                shearHybrid(animal, player, serverWorld);
            }
            return ActionResult.SUCCESS;
        }

        if (!held.isOf(Items.GOLDEN_APPLE)) {
            return ActionResult.PASS;
        }
        if (world.isClient) {
            return ActionResult.SUCCESS;
        }
        if (!(world instanceof ServerWorld serverWorld) || !(player instanceof ServerPlayerEntity serverPlayer)) {
            return ActionResult.PASS;
        }

        return feedForBreeding(serverPlayer, hand, animal, serverWorld);
    }

    private ActionResult feedForBreeding(ServerPlayerEntity player, Hand hand, AnimalEntity animal,
                                         ServerWorld world) {
        UUID pendingUuid = PENDING_PARENT.get(player.getUuid());
        Entity pendingEntity = pendingUuid == null ? null : world.getEntity(pendingUuid);
        if (!(pendingEntity instanceof AnimalEntity first) || !first.isAlive()) {
            PENDING_PARENT.remove(player.getUuid());
            if (consumeOne(player, hand)) {
                PENDING_PARENT.put(player.getUuid(), animal.getUuid());
                player.sendMessage(Text.literal("Fed! Use another Golden Apple on a different animal to hatch a hybrid."), true);
            }
            return ActionResult.SUCCESS;
        }

        if (first.getUuid().equals(animal.getUuid())) {
            player.sendMessage(Text.literal("Choose a different animal for the second parent."), true);
            return ActionResult.SUCCESS;
        }

        EntityType<?> bodyType = world.random.nextBoolean() ? first.getType() : animal.getType();
        Entity offspring = bodyType.create(world);
        if (!(offspring instanceof AnimalEntity hybrid)) {
            player.sendMessage(Text.literal("These animals could not produce an offspring."), true);
            return ActionResult.SUCCESS;
        }

        hybrid.refreshPositionAndAngles(animal.getX(), animal.getY(), animal.getZ(), animal.getYaw(), 0.0F);
        hybrid.setBreedingAge(-24000);
        hybrid.addCommandTag(HYBRID_TAG);
        Set<String> genes = collectGenes(first);
        genes.addAll(collectGenes(animal));
        for (String gene : genes) {
            hybrid.addCommandTag(GENE_PREFIX + gene);
        }
        hybrid.setCustomName(Text.literal("Hybrid: " + first.getName().getString() + " × " + animal.getName().getString()));
        hybrid.setCustomNameVisible(true);

        if (!world.spawnEntity(hybrid)) {
            return ActionResult.FAIL;
        }

        consumeOne(player, hand);
        PENDING_PARENT.remove(player.getUuid());
        player.sendMessage(Text.literal("A new hybrid has been born! Its inherited traits persist through future generations."), true);
        return ActionResult.SUCCESS;
    }

    private void attractAnimals(ServerWorld world) {
        if (world.getTime() % 10 != 0) {
            return;
        }

        for (ServerPlayerEntity player : world.getPlayers()) {
            if (!isHoldingGoldenApple(player)) {
                continue;
            }

            for (AnimalEntity animal : world.getEntitiesByClass(AnimalEntity.class,
                    player.getBoundingBox().expand(APPROACH_RANGE), AnimalEntity::isAlive)) {
                animal.getNavigation().startMovingTo(player, 1.05);
            }
        }
    }

    private boolean isHoldingGoldenApple(PlayerEntity player) {
        return player.getStackInHand(Hand.MAIN_HAND).isOf(Items.GOLDEN_APPLE)
                || player.getStackInHand(Hand.OFF_HAND).isOf(Items.GOLDEN_APPLE);
    }

    private void milkHybrid(ServerPlayerEntity player, Hand hand) {
        ItemStack bucket = player.getStackInHand(hand);
        ItemStack milk = new ItemStack(Items.MILK_BUCKET);
        if (player.isCreative()) {
            if (!player.getInventory().insertStack(milk)) {
                player.dropItem(milk, false);
            }
        } else if (bucket.getCount() == 1) {
            player.setStackInHand(hand, milk);
        } else {
            bucket.decrement(1);
            if (!player.getInventory().insertStack(milk)) {
                player.dropItem(milk, false);
            }
        }
        player.sendMessage(Text.literal("You milked the hybrid."), true);
    }

    private void shearHybrid(AnimalEntity animal, PlayerEntity player, ServerWorld world) {
        long regrowAt = getShearedUntil(animal);
        if (world.getTime() < regrowAt) {
            player.sendMessage(Text.literal("This hybrid's wool is still growing back."), true);
            return;
        }

        removeShearedTags(animal);
        animal.addCommandTag(SHEARED_UNTIL_PREFIX + (world.getTime() + WOOL_REGROW_TICKS));
        animal.dropStack(new ItemStack(Items.WHITE_WOOL, world.random.nextInt(3) + 1));
        player.sendMessage(Text.literal("You sheared the hybrid."), true);
    }

    private long getShearedUntil(AnimalEntity animal) {
        for (String tag : animal.getCommandTags()) {
            if (tag.startsWith(SHEARED_UNTIL_PREFIX)) {
                try {
                    return Long.parseLong(tag.substring(SHEARED_UNTIL_PREFIX.length()));
                } catch (NumberFormatException ignored) {
                    return Long.MAX_VALUE;
                }
            }
        }
        return Long.MIN_VALUE;
    }

    private void removeShearedTags(AnimalEntity animal) {
        for (String tag : Set.copyOf(animal.getCommandTags())) {
            if (tag.startsWith(SHEARED_UNTIL_PREFIX)) {
                animal.removeCommandTag(tag);
            }
        }
    }

    private boolean isHybrid(AnimalEntity animal) {
        return animal.getCommandTags().contains(HYBRID_TAG);
    }

    private boolean hasGene(AnimalEntity animal, String gene) {
        return animal.getCommandTags().contains(GENE_PREFIX + gene);