Marcel

I want to make a mod that ads a new mob a dog that looks at my dog

Kodari AI
KodariSep 14 at 1:39 pm 1
LoyalCompanion
Adds a new tamable dog mob to Minecraft that exhibits lifelike behavior by visually tracking and gazing at the player. The LoyalCompanion mod introduces a custom entity with distinct textures, AI routines for following and sitting, and a bonding system where the dog's gaze direction dynamically follows the player's position. Includes spawn eggs, breeding mechanics, and configurable loyalty behaviors for an immersive companion experience.
  1. Create a Fabric 1.21.11 project with split main/client source sets.

  2. Register a wolf-based Dog Watcher mob with vanilla wolf rendering.

  3. Add AI that makes it look at nearby wolves, including a player’s tamed dog, plus /summon dogwatcher:dog_watcher support through normal entity registration.

Created a Fabric 1.21.11 mod named Dog Watcher.

  • Adds dogwatcher:dog_watcher

  • Uses the vanilla wolf appearance and renderer

  • Watches nearby wolves, including tamed player dogs

  • Can be spawned with:

Mcfunction
/summon dogwatcher:dog_watcher
Marcel

Make now realistic movement and animations siting by itself sleeping playing climbing walking etc

Kodari AI
KodariSep 14 at 3:01 pm 2
  1. Upgrade the entity’s movement and behavior with autonomous sitting, sleeping, playing, climbing, and normal walking.

  2. Reuse the vanilla wolf’s proven animation/rendering pipeline so the new mob visibly performs those actions.

  3. Keep the existing dogwatcher:dog_watcher registration and summon command compatible.

  1. Added autonomous behavior to DogWatcherEntity:

    • Sits and rests randomly.

    • Sleeps using the sleeping pose.

    • Plays with nearby wolves and tamed dogs.

    • Runs toward playmates, looks at them, and jumps.

    • Jumps when blocked to climb ledges.

  2. Preserved vanilla wolf movement and animation rendering:

    • Walking animation.

    • Sitting animation.

    • Begging/play animation.

    • Jumping and head-look movement.

  3. Kept the existing entity registration and /summon dogwatcher:dog_watcher command unchanged.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
9 360
src/main/java/com/example/dogwatcher/DogWatcherMod.java
package com.example.dogwatcher;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DogWatcherMod implements ModInitializer {
    public static final String MOD_ID = "dogwatcher";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        ModEntityTypes.initialize();
        LOGGER.info("Dog Watcher initialized");
    }
}