Nol
📎 1 file 2,212 chars
📄
pasted-code-1790538908134.txt
txt 68 lines
▶
Make me a Minecraft Paper/Spigot plugin called Streak SMP.

The entire plugin should be based around a player's kill streak.

Core mechanic
Every player starts with a 0 kill streak.
When a player kills another player, their streak increases by 1.
The player's current streak must be displayed above their head/name so other players can see it.
Example: 🔥 7 STREAK
When a player dies to another player, their kill streak is immediately reset to 0.
Their earned Strength level should also reset when their streak resets.
Strength system

Increase the killer's Strength based on their current streak:

0–3 streak = no Strength
4–6 streak = Strength I
7–10 streak = Strength II
11–15 streak = Strength III
16–20 streak = Strength IV
21+ streak = Strength V

The Strength effect should automatically update whenever the player's streak changes.

Deaths
Dying to another player resets the victim's streak to 0.
Dying should also remove their Strength effect.
Make sure Strength from this plugin does not permanently stack or conflict with the streak system.
If a player dies from something other than a player, reset their streak as well.
Streak display

Show the player's current streak above their head using a visible name/tag.

Examples:

🔥 0 STREAK
🔥 5 STREAK
🔥 17 STREAK

The display should update instantly after every kill or death.

Commands

Add:

/streak — shows your current streak and Strength level.
/streak  — shows another player's streak.
/streak reset  — admin command to reset someone's streak.
/streak reload — reloads the config.
Configuration

Put the following in config.yml so I can easily change them:

Strength levels
Streak requirements
Maximum Strength level
Streak display format
Whether non-player deaths reset streaks
Messages
Important

Make the plugin lightweight and compatible with modern Paper Minecraft servers.

Do NOT add random abilities, currencies, quests, teams, GUI menus, or complicated systems. The main mechanic should ONLY be:

Kill → streak goes up → Strength gets stronger → streak is visible above your head → die → streak resets.

Give me the complete plugin source code, plugin.yml, config.yml, and clear instructions for building/installing it.
Kodari AI
KodariSep 27 at 7:56 pm 1
StreakSMP
A lightweight Paper/Spigot plugin centered on player kill streaks. Tracks each player's kill streak, displays it live above their head with a configurable format (e.g., 🔥 7 STREAK), and grants escalating Strength levels based on streak thresholds (I through V). Streaks increase on player kills and reset on any death, automatically clearing the Strength effect. Includes commands to view personal or other players' streaks, admin reset, and config reload. Fully configurable via config.yml for strength tiers, display format, messages, and death behavior. Optimized for modern Paper servers with no extra systems.
  1. Add the Paper/Spigot plugin, kill-streak persistence, overhead display, Strength scaling, and commands.

  2. Add configurable defaults, plugin/build metadata, and build/install instructions.

Created the Streak SMP plugin with persistent streaks, overhead streak labels, configurable Strength thresholds, death resets, and /streak commands.

Build with gradle build; install build/libs/StreakSMP-1.0.0.jar in the server’s plugins directory. See README.md for requirements, commands, and configuration details.

Nol

what does it do

Kodari AI
KodariSep 27 at 7:59 pm 1

Streak SMP tracks player kill streaks. Each player kill adds 1 to the killer’s streak, updates their visible 🔥 [streak] STREAK name tag, and adjusts their Strength effect according to the configured thresholds. When a player dies, their streak resets and the plugin removes its Strength effect.

Players can use /streak to check their streak, /streak <player> to view someone else’s, and admins can use /streak reset <player> or /streak reload. The config lets you change the display, Strength tiers, messages, and whether non-player deaths reset streaks.

Nol

i dont see it over my head

Kodari AI
KodariSep 27 at 8:00 pm 1
  1. Replace Player.setCustomName (which doesn’t show above player names) with a scoreboard name-tag prefix.

  2. Remove the plugin’s tags cleanly on quit and shutdown.

Fixed the overhead display: it now uses a scoreboard name-tag prefix instead of setCustomName, which doesn’t show above player names. Rebuild the plugin, replace the old JAR, and restart the server for the change to take effect.

Nol

download file?

Kodari AI
KodariSep 27 at 8:00 pm 1

I can’t attach a prebuilt .jar here. Build it from the project source with gradle build; the plugin file will be at build/libs/StreakSMP-1.0.0.jar. Upload that JAR to your server’s plugins folder and restart.

Nol

where do i downlooad the file of the plugin u gave me

Kodari AI
KodariSep 27 at 8:01 pm 1

There isn’t a downloadable .jar attached yet—I only added the source files. Build the project with gradle build; the plugin will be created at build/libs/StreakSMP-1.0.0.jar. Then download that JAR from the project’s file browser and put it in your server’s plugins folder.

Nol

StreakSMP-1.0.0 (1).jar could harm your device. Do you want to keep it anyway? this up here?

Kodari AI
KodariSep 27 at 8:01 pm 1

That warning is common for .jar files because they can run code; it doesn’t necessarily mean the plugin is malicious. If you built the JAR from this project’s source, keep it only if you trust that source. Install it on your Minecraft server in the plugins folder—don’t open or run it on your computer. If you didn’t expect the file or aren’t sure where it came from, cancel the download and delete it.

Nol

did u fix the plugin so it shows it

Kodari AI
KodariSep 27 at 8:02 pm 1

Yes—the plugin source was changed to use a scoreboard name-tag prefix, which displays above the player’s head. You’ll need to build/download the updated JAR after that change and restart the server; an older JAR won’t include the fix.

Nol

now where do i get the new jar'

Kodari AI
KodariSep 27 at 8:02 pm 1

There isn’t a new JAR available to download here—the updated source was changed, but no JAR was generated. Build the project with gradle build; the new file will be at build/libs/StreakSMP-1.0.0.jar. Replace the old JAR on your server with that one, then restart.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
6 434
src/main/java/com/kodari/streaksmp/StreakSMP.java
package com.kodari.streaksmp;

import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.ChatColor;

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

public final class StreakSMP extends JavaPlugin implements Listener {
    private static final String ADMIN_PERMISSION = "streaksmp.admin";

    private final Map<UUID, Integer> streaks = new HashMap<>();
    private final Map<UUID, PotionEffect> previousStrengthEffects = new HashMap<>();
    private final Map<UUID, Team> streakTeams = new HashMap<>();
    private final Map<UUID, Boolean> managedStrength = new HashMap<>();
    private File dataFile;
    private PotionEffectType strengthType;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataFile = new File(getDataFolder(), "data.yml");
        loadStreaks();
        strengthType = Registry.POTION_EFFECT_TYPE.get(NamespacedKey.minecraft("strength"));
        if (strengthType == null) {
            getLogger().severe("The Strength potion effect is unavailable; streak tracking will still work.");
        }
        getServer().getPluginManager().registerEvents(this, this);
        for (Player player : Bukkit.getOnlinePlayers()) {
            refreshPlayer(player);
        }
    }

    @Override
    public void onDisable() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            clearStrength(player, true, false);
        }
        clearDisplays();
        saveStreaks();
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        refreshPlayer(event.getPlayer());
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        clearStrength(player, true, false);
        clearDisplay(player);
    }

    @EventHandler
    public void onPlayerRespawn(PlayerRespawnEvent event) {
        Player player = event.getPlayer();
        Bukkit.getScheduler().runTask(this, () -> {
            if (player.isOnline()) {
                refreshPlayer(player);
            }
        });
    }

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player victim = event.getEntity();
        Player killer = victim.getKiller();
        if (killer == null && !getConfig().getBoolean("reset-on-non-player-death", true)) {
            return;
        }

        streaks.put(victim.getUniqueId(), 0);
        saveStreaks();
        updateDisplay(victim);
        clearStrength(victim, false, true);

        if (killer != null) {
            setStreak(killer, getStreak(killer) + 1);
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) {
            if (!(sender instanceof Player player)) {
                sendMessage(sender, "messages.player-only", Map.of());
                return true;
            }
            sendStreak(sender, player);
            return true;
        }

        if (args[0].equalsIgnoreCase("reload") && args.length == 1) {
            if (!requireAdmin(sender)) {
                return true;
            }
            reloadConfig();
            for (Player player : Bukkit.getOnlinePlayers()) {
                refreshPlayer(player);
            }
            sendMessage(sender, "messages.reloaded", Map.of());
            return true;
        }

        if (args[0].equalsIgnoreCase("reset") && args.length == 2) {
            if (!requireAdmin(sender)) {
                return true;
            }
            Player target = Bukkit.getPlayerExact(args[1]);
            if (target == null) {
                sendMessage(sender, "messages.player-not-found", Map.of("player", args[1]));
                return true;
            }
            setStreak(target, 0);
            sendMessage(sender, "messages.reset", Map.of("player", target.getName()));
            return true;
        }

        if (args.length == 1) {
            Player target = Bukkit.getPlayerExact(args[0]);
            if (target == null) {
                sendMessage(sender, "messages.player-not-found", Map.of("player", args[0]));
                return true;
            }
            sendStreak(sender, target);
            return true;
        }

        sendMessage(sender, "messages.usage", Map.of());
        return true;
    }

    private void refreshPlayer(Player player) {
        streaks.putIfAbsent(player.getUniqueId(), 0);
        updateDisplay(player);
        updateStrength(player);
    }

    private int getStreak(Player player) {
        return streaks.getOrDefault(player.getUniqueId(), 0);
    }

    private void setStreak(Player player, int streak) {
        streaks.put(player.getUniqueId(), Math.max(0, streak));
        saveStreaks();
        updateDisplay(player);
        updateStrength(player);
    }

    private void updateDisplay(Player player) {
        UUID uuid = player.getUniqueId();
        Team team = streakTeams.get(uuid);
        Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        if (team == null || scoreboard.getTeam(team.getName()) != team) {
            String teamName = "ss" + uuid.toString().replace("-", "").substring(0, 14);
            team = scoreboard.getTeam(teamName);
            if (team == null) {
                team = scoreboard.registerNewTeam(teamName);
            }
            streakTeams.put(uuid, team);
        }
        String format = getConfig().getString("display-format", "🔥 %streak% STREAK");
        team.setPrefix(color(format.replace("%streak%", String.valueOf(getStreak(player)))) + " ");
        team.addEntry(player.getName());
    }

    private void clearDisplay(Player player) {
        Team team = streakTeams.remove(player.getUniqueId());
        if (team != null && Bukkit.getScoreboardManager().getMainScoreboard().getTeam(team.getName()) == team) {
            team.removeEntry(player.getName());
            team.unregister();
        }
    }

    private void clearDisplays() {
        Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
        for (Team team : streakTeams.values()) {