F

I want too make a taunt for my earth dog summon, when enemies are around EarthDog certain distance enemies are aggroed onto the EarthDog protecting the player, remember this is singleplayer so you can use easy targeting like !player

Kodari AI
KodariJun 7 at 3:51 am 1

I’ll create an Earth Dog summon plugin - a tamed wolf companion that follows you and taunts nearby hostile mobs to protect you.

EarthDogTaunt
A singleplayer pet taunt plugin that summons an Earth Dog companion. The Earth Dog follows the player and automatically taunts hostile mobs within a configurable radius, causing them to aggro onto the dog instead of the player. Features include toggleable summoning, custom health scaling, visual taunt aura effects, and auto-respawn on death.

Let me plan the file structure:

  1. plugin.yml - plugin descriptor

  2. config.yml - configuration (radius, health, effects)

  3. EarthDogPlugin.java - main class, commands, scheduler

  4. EarthDogManager.java - controls the dog: summon, dismiss, follow, taunt aura loop

[Generation stopped]

F

i just wanted commands for a datapack

Kodari AI
KodariJun 7 at 3:52 am 1

Got it — Minecraft datapack with functions. Plan:

  1. pack.mcmeta — datapack descriptor

  2. data/earthdog/functions/summon.mcfunction — spawns the Earth Dog

  3. data/earthdog/functions/taunt.mcfunction — tags on tick, aggros mobs to dog

  4. data/earthdog/functions/kill.mcfunction — removes the dog

  5. data/earthdog/functions/remove_tag.mcfunction — cleanup

  6. data/minecraft/tags/functions/tick.json — runs taunt each tick

Drop the EarthDog folder into your world’s datapacks/ folder, then run:

  • /function earthdog:summon — spawns a black-collared wolf with 40 hearts

  • /function earthdog:kill — removes it

The taunt runs automatically every tick — any hostile mob (zombie, skeleton, creeper, spider, etc.) within 12 blocks of you gets its target set to the Earth Dog.

F

so i need too create a predicates folder and paste the contents

Kodari AI
KodariJun 7 at 4:13 am 1

The file already exists at datapacks/EarthDog/data/earthdog/predicates/is_hostile.json — it was created in my last response. Just make sure your folder tree looks like this in your world save:

Plain Text
world/
└── datapacks/
    └── EarthDog/
        ├── pack.mcmeta
        └── data/
            ├── minecraft/
            │   └── tags/
            │       └── functions/
            │           └── tick.json
            └── earthdog/
                ├── functions/
                │   ├── summon.mcfunction
                │   ├── taunt.mcfunction
                │   └── kill.mcfunction
                └── predicates/
                    └── is_hostile.json

Running /reload and then /function earthdog:summon should work. The dog follows you, taunts nearby mobs within 12 blocks, and has 40 hearts.

F

for predicate=earthdog:is_hostile is it detecting the tagged entitiy earthdog or is it a file in the pack

Kodari can make mistakes. Review important code before using.
Files
datapacks
src
Code
10 273
src/main/java/com/earthdog/EarthDogPlugin.java
package com.earthdog;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class EarthDogPlugin extends JavaPlugin {

    private EarthDogManager dogManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dogManager = new EarthDogManager(this);
        getLogger().info("EarthDogTaunt enabled! Use /earthdog to summon.");
    }

    @Override
    public void onDisable() {
        if (dogManager != null) {
            dogManager.dismissAll();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage(ChatColor.RED + "Only players can use this command.");
            return true;
        }

        if (!command.getName().equalsIgnoreCase("earthdog")) {
            return false;
        }

        if (args.length > 0 && args[0].equalsIgnoreCase("dismiss")) {
            dogManager.dismiss(player);
            player.sendMessage(ChatColor.GREEN + "Earth Dog dismissed.");
            return true;
        }

        if (dogManager.hasActiveDog(player)) {
            dogManager.dismiss(player);
            player.sendMessage(ChatColor.GREEN + "Earth Dog dismissed.");
        } else {
            dogManager.summon(player);
            player.sendMessage(ChatColor.GREEN + "Earth Dog summoned! It will protect you.");
        }
        return true;
    }

    public EarthDogManager getDogManager() {
        return dogManager;
    }
}