Tristan Butterworth

can you create a plugin for an ffa where above every players head it shows their deaths kills and heakth and for each one dont say death or something make it a symbol for example death is a skull health is a heart and kills is a sword

Kodari AI
KodariNov 8 at 6:39 pm 1
FFAHUDDisplay
Creates a Free-For-All (FFA) arena plugin that displays a holographic HUD above each player's head. The HUD shows kills, deaths, and health using symbolic icons: a sword for kills, a skull for deaths, and a heart for health. The display updates in real-time as players engage in combat, with health reflecting current HP and kill/death counters tracking arena statistics. Configurable icon symbols and update intervals are supported.

I’ll create a three-line display above each player: ☠ deaths, ⚔ kills, and ♥ health. Kills and deaths will persist across restarts.

Created the FFA display plugin. Each player has three lines above their head:

  • ☠ Deaths

  • ⚔ Kills

  • ♥ Health

Kills and deaths are saved across server restarts.

Tristan Butterworth

but dont make it emojis make it pixels

Kodari AI
KodariNov 8 at 6:42 pm 1

The current symbols use Minecraft’s font, but they’re Unicode characters rather than custom pixel-art icons. Distinct pixel-art skull, sword, and heart icons would need a resource pack, which Kodari doesn’t currently build.

Pixel art can be created with Kodari Studio. Enable it in this project under Settings → Generation, or for all projects at https://kodari.ai/settings?tab=features.

Tristan Butterworth

can you make it go health then kills then deaths

Kodari AI
KodariNov 8 at 7:04 pm 1

I’ll reorder the display from top to bottom: health, kills, then deaths.

The display now reads top to bottom: health, kills, deaths.

Tristan Butterworth

can you make the health red the kills blue and deaths grey

Kodari AI
KodariNov 8 at 7:09 pm 1

The display now shows health in red, kills in blue, and deaths in grey.

Tristan Butterworth

can you make it so it doesnt bounce and it is in 3 rectangle boxes next to eachother like kills health death and the box has an outline

Kodari AI
KodariNov 8 at 8:04 pm 1
  • Arrange the stats horizontally in outlined boxes.

  • Smooth the display’s movement and keep the existing colours.

The display now shows kills, health, and deaths side by side, with text-drawn outlines and smoother movement. It uses Minecraft’s font, so the outlines may not align perfectly with every character.

Tristan Butterworth

make it as small as the name and make it so the lines dont have gaps and make the lines black

Kodari AI
KodariNov 8 at 8:06 pm 1

I’ll shrink the display, colour the borders black, and remove the spaces between the boxes. Minecraft’s font may still leave small gaps between border characters.

Shrunk the display, made the borders black, and removed spaces between the boxes. The font may still leave small gaps in the lines.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 159
src/main/java/com/kodari/ffadisplay/FFADisplay.java
package com.kodari.ffadisplay;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Display;
import org.bukkit.entity.Player;
import org.bukkit.entity.TextDisplay;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Transformation;
import org.joml.Vector3f;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class FFADisplay extends JavaPlugin implements Listener {
    private final Map<UUID, TextDisplay> displays = new HashMap<>();
    private File statsFile;
    private YamlConfiguration stats;

    @Override
    public void onEnable() {
        statsFile = new File(getDataFolder(), "stats.yml");
        stats = YamlConfiguration.loadConfiguration(statsFile);
        getServer().getPluginManager().registerEvents(this, this);
        Bukkit.getScheduler().runTaskTimer(this, this::updateDisplays, 1L, 1L);
    }

    @Override
    public void onDisable() {
        for (UUID id : displays.keySet().toArray(new UUID[0])) {
            removeDisplay(id);
        }
        saveStats();
    }

    @EventHandler
    public void onDeath(PlayerDeathEvent event) {
        Player victim = event.getEntity();
        String victimKey = victim.getUniqueId().toString();
        stats.set(victimKey + ".deaths", stats.getInt(victimKey + ".deaths") + 1);
        Player killer = victim.getKiller();
        if (killer != null && !killer.getUniqueId().equals(victim.getUniqueId())) {
            String killerKey = killer.getUniqueId().toString();
            stats.set(killerKey + ".kills", stats.getInt(killerKey + ".kills") + 1);
        }
        removeDisplay(victim.getUniqueId());
        saveStats();
    }

    @EventHandler
    public void onQuit(PlayerQuitEvent event) {
        removeDisplay(event.getPlayer().getUniqueId());
    }

    private void updateDisplays() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            if (player.isDead()) {
                removeDisplay(player.getUniqueId());
                continue;
            }
            TextDisplay display = displays.get(player.getUniqueId());
            if (display == null || !display.isValid() || !display.getWorld().equals(player.getWorld())) {
                removeDisplay(player.getUniqueId());
                display = createDisplay(player);
                displays.put(player.getUniqueId(), display);
            }
            String key = player.getUniqueId().toString();
            String kills = "⚔ " + stats.getInt(key + ".kills");
            String health = "♥ " + formatHealth(player.getHealth());
            String deaths = "☠ " + stats.getInt(key + ".deaths");
            String top = border(kills, '┌', '┐') + border(health, '┌', '┐') + border(deaths, '┌', '┐');
            String middle = ChatColor.BLACK + "│" + ChatColor.BLUE + kills + ChatColor.BLACK + "│"
                    + "│" + ChatColor.RED + health + ChatColor.BLACK + "│"
                    + "│" + ChatColor.GRAY + deaths + ChatColor.BLACK + "│";
            String bottom = border(kills, '└', '┘') + border(health, '└', '┘') + border(deaths, '└', '┘');
            display.setText(ChatColor.BLACK + top + "\n" + middle + "\n" + ChatColor.BLACK + bottom);
            Location base = player.getLocation().add(0, player.getHeight() + 0.35, 0);
            display.teleport(base);
        }
    }

    private TextDisplay createDisplay(Player player) {
        return player.getWorld().spawn(player.getLocation(), TextDisplay.class, display -> {
            display.setBillboard(Display.Billboard.CENTER);
            display.setBackgroundColor(Color.fromARGB(0));
            display.setShadowed(false);
            display.setPersistent(false);
            display.setTeleportDuration(1);
            Transformation transformation = display.getTransformation();
            transformation.getScale().set(new Vector3f(0.5f));
            display.setTransformation(transformation);
        });
    }

    private String border(String text, char left, char right) {
        return left + "─".repeat(text.length()) + right;
    }

    private void removeDisplay(UUID id) {
        TextDisplay display = displays.remove(id);
        if (display != null) {
            display.remove();
        }
    }

    private String formatHealth(double health) {
        return health == Math.floor(health)
                ? String.format(Locale.ROOT, "%.0f", health)
                : String.format(Locale.ROOT, "%.1f", health);
    }

    private void saveStats() {
        if (!getDataFolder().exists() && !getDataFolder().mkdirs()) {
            getLogger().warning("Could not create the plugin data folder.");
            return;
        }
        try {
            stats.save(statsFile);
        } catch (IOException exception) {
            getLogger().severe("Could not save FFA stats: " + exception.getMessage());
        }
    }
}