stupid person

make a plugin where everyone starts at 100k seconds and the more time you have the higher buffs the first to get the dragon egg gets infinite time and a mace that bans players that it kills named "Ban Hammer" and it have a good buff like it can dash or something. every kill 15% of a players time, also add a crafting recipe 1 egap 2 totems 4 netherite scrap and the rest gold ingots for 50k seconds make it show above your hotbar and above your name + on the tab next to your name also make a revival beacon that costs 250k seconds the command is /revive the player that gets revived starts at 50k

Kodari AI
KodariNov 3 at 7:14 am 2
TimeEmpire
TimeEmpire is a Minecraft plugin where every player starts with 100,000 seconds of time. Time acts as currency and power: the more time you have, the stronger buffs you receive (speed, strength, resistance, etc.). Killing another player steals 15% of their time. The first player to obtain the Dragon Egg gains infinite time and a special "Ban Hammer" mace that bans any player it kills, and grants a dash ability. A crafting recipe (1 Ender Pearl, 2 Totems, 4 Netherite Scrap, rest Gold Ingots) grants 50,000 seconds. Time is displayed above the hotbar, above player names, and in the tab list. A revival beacon costs 250,000 seconds; using /revive resurrects a dead player who starts with 50,000 seconds.

I’ll build the time economy, buffs and displays first, then add the dragon-egg prize, crafted time item and revival command.

Built TimeSMP for Minecraft 1.21+.

  • Players start with 100,000 seconds; time counts down while online, and kills steal 15% of the victim’s finite time.

  • Higher time grants stronger buffs. Time appears above the hotbar, in name tags and in the player list.

  • The first player to pick up a dragon egg gets infinite time and a Ban Hammer with a five-second dash cooldown.

  • /revive <player> costs 250,000 seconds and restores a Ban Hammer victim with 50,000 seconds.

  • Craft a 50,000-second token with enchanted golden apple in the center, netherite scrap in the corners, totems above and below, and gold ingots on the sides. Right-click it to claim the time.

At zero time, players remain alive but no longer receive time-based buffs.

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

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import org.bukkit.BanList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector;

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

public final class TimeSMP extends JavaPlugin implements Listener {
    private static final long START = 100000L;
    private static final long REVIVE_COST = 250000L;
    private final Map<UUID, Long> dashCooldowns = new HashMap<>();
    private File dataFile;
    private YamlConfiguration data;
    private NamespacedKey hammerKey;
    private NamespacedKey timeItemKey;

    @Override
    public void onEnable() {
        hammerKey = new NamespacedKey(this, "ban_hammer");
        timeItemKey = new NamespacedKey(this, "time_token");
        dataFile = new File(getDataFolder(), "data.yml");
        data = YamlConfiguration.loadConfiguration(dataFile);
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("revive").setExecutor((sender, command, label, args) -> {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can revive someone.");
                return true;
            }
            if (args.length != 1) return false;
            OfflinePlayer target = Bukkit.getOfflinePlayer(args[0]);
            String path = "hammer-bans." + target.getUniqueId();
            if (!data.getBoolean(path, false)) {
                player.sendMessage(ChatColor.RED + "That player is not banned by the Ban Hammer.");
                return true;
            }
            if (!isInfinite(player.getUniqueId()) && getTime(player.getUniqueId()) < REVIVE_COST) {
                player.sendMessage(ChatColor.RED + "You need 250,000 seconds to revive a player.");
                return true;
            }
            if (!isInfinite(player.getUniqueId())) setTime(player.getUniqueId(), getTime(player.getUniqueId()) - REVIVE_COST);
            setTime(target.getUniqueId(), 50000);
            data.set(path, null);
            Bukkit.getBanList(BanList.Type.NAME).pardon(args[0]);
            saveData();
            Bukkit.broadcastMessage(ChatColor.GOLD + player.getName() + " revived " + args[0] + " with 50,000 seconds!");
            return true;
        });
        registerRecipe();
        for (Player player : Bukkit.getOnlinePlayers()) initialize(player);
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                UUID id = player.getUniqueId();
                if (!isInfinite(id)) setTime(id, Math.max(0, getTime(id) - 1));
                updateDisplay(player);
                applyBuffs(player);
            }
        }, 20L, 20L);
        Bukkit.getScheduler().runTaskTimer(this, this::saveData, 1200L, 1200L);
    }

    @Override
    public void onDisable() {
        saveData();
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.setPlayerListName(null);
            Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName(player));
            if (team != null) team.unregister();
        }
    }

    private long getTime(UUID id) {
        return data.getLong("players." + id + ".time", START);
    }

    private void setTime(UUID id, long seconds) {
        data.set("players." + id + ".time", Math.max(0, seconds));
    }

    private boolean isInfinite(UUID id) {
        return data.getBoolean("players." + id + ".infinite", false);
    }

    private void saveData() {
        try {
            data.save(dataFile);
        } catch (IOException e) {
            getLogger().severe("Could not save time data: " + e.getMessage());
        }
    }

    private void initialize(Player player) {
        String path = "players." + player.getUniqueId() + ".time";
        if (!data.contains(path)) data.set(path, START);
        updateDisplay(player);
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        initialize(event.getPlayer());
    }

    @EventHandler
    public void onQuit(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName(player));
        if (team != null) team.unregister();
        dashCooldowns.remove(player.getUniqueId());
        saveData();
    }

    private String teamName(Player player) {
        return "ts" + player.getUniqueId().toString().replace("-", "").substring(0, 14);
    }

    private void updateDisplay(Player player) {
        String value = isInfinite(player.getUniqueId()) ? "∞" : String.format("%,d", getTime(player.getUniqueId())) + "s";
        player.sendActionBar(ChatColor.GOLD + "Time: " + value);
        player.setPlayerListName(ChatColor.GOLD + "[" + value + "] " + ChatColor.RESET + player.getName());
        Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
        Team team = board.getTeam(teamName(player));
        if (team == null) team = board.registerNewTeam(teamName(player));
        team.setPrefix(ChatColor.GOLD + "[" + value + "] " + ChatColor.RESET);
        team.addEntry(player.getName());
    }

    private void applyBuffs(Player player) {
        long time = isInfinite(player.getUniqueId()) ? Long.MAX_VALUE : getTime(player.getUniqueId());
        if (time >= 50000) effect(player, "SPEED", time >= 250000 ? 1 : 0);
        if (time >= 100000) effect(player, "HASTE", time >= 300000 ? 1 : 0);
        if (time >= 150000) effect(player, "STRENGTH", time >= 400000 ? 1 : 0);
        if (time >= 200000) effect(player, "RESISTANCE", 0);
    }

    private void effect(Player player, String name, int amplifier) {
        XPotion.matchXPotion(name).map(potion -> potion.buildPotionEffect(60, amplifier)).ifPresent(player::addPotionEffect);
    }

    private Material material(String name) {
        return XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial).orElseThrow(() -> new IllegalStateException("Missing material " + name));
    }

    private ItemStack specialItem(String material, String name, String lore, NamespacedKey key) {
        ItemStack item = new ItemStack(material(material));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + name);
        meta.setLore(Collections.singletonList(ChatColor.GRAY + lore));
        meta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (byte) 1);
        item.setItemMeta(meta);
        return item;
    }

    private boolean isSpecial(ItemStack item, NamespacedKey key) {
        return item != null && item.hasItemMeta() && item.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.BYTE);
    }

    private void registerRecipe() {
        ItemStack token = specialItem("NETHER_STAR", "50,000 Seconds", "Right-click to claim 50,000 seconds", timeItemKey);
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "time_token"), token);
        recipe.shape("STS", "GEG", "STS");
        recipe.setIngredient('S', material("NETHERITE_SCRAP"));
        recipe.setIngredient('T', material("TOTEM_OF_UNDYING"));
        recipe.setIngredient('G', material("GOLD_INGOT"));
        recipe.setIngredient('E', material("ENCHANTED_GOLDEN_APPLE"));
        Bukkit.addRecipe(recipe);
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onEggPickup(EntityPickupItemEvent event) {
        if (!(event.getEntity() instanceof Player player) || event.getItem().getItemStack().getType() != material("DRAGON_EGG") || data.getBoolean("egg-claimed")) return;
        data.set("egg-claimed", true);
        data.set("players." + player.getUniqueId() + ".infinite", true);