Skip to content

How to make your own Death Animation

Nik edited this page Aug 2, 2026 · 1 revision

In this example, We'll be making a Death Animation that executes a command after 5 seconds

First, Let's make a Class named Test that extends DeathAnimation and implement all the methods

public class Test extends DeathAnimation {
    public Test(String name) {
        super(name);
    }

    @Override
    public void execute(Player player) {
    }
}

The string parameter in the constructor will be the name of the DeathAnimation that we can then use inside the config.yml, For this case we'll name it "TEST"

public Test() {
        super("TEST");
    }

Let's finish this off, our class should now look like this

public class Test extends DeathAnimation {
    public Test() {
        super("TEST");
    }

    @Override
    public void execute(Player player) {

        new BukkitRunnable() {
            @Override
            public void run() {
                Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "your-command-here");
            }
        }.runTaskLater(YourPluginInstance, 100);
    }
}

Perfect, now all that's left to do is register our Animation on startup!

QualityCombatAPI api = QualityCombatAPIProvider.getAPI();
        api.registerDeathAnimation(new Test());

Don't forget to add QualityCombat as a dependency on your Plugin

Clone this wiki locally