Lucky Shukla
📎 1 file 1,440 chars
📄
pasted-code-1790245924082.txt
txt 24 lines
▶
I want a plugin with the following features:

After the Ender Dragon is killed for the first time, the Ender Dragon Egg should be given to the first player who obtains it. A 10-minute timer should then start for everyone on the server.

If another player kills the player who currently has the Ender Dragon Egg and somehow obtains the egg, the 10-minute timer should reset from the beginning.

The name of the player who currently owns the Ender Dragon Egg should be displayed at the bottom of the screen. The timer should only run while the Ender Dragon Egg is in that player's inventory. If the egg is removed from their inventory, the timer should stop.

When the 10-minute timer is completed, that player should receive two Maces. Maces should not be craftable on the server. Both Maces should already have these enchantments:

- Wind Burst III
- Density V
- Mending
- Unbreaking III

As soon as the Maces are awarded, the server's Lives system should be activated.

Every player should start with 10 Lives. If a player dies from normal causes, they should not lose a Life. However, if a player is killed by another player, the victim should lose one Life.

When a player reaches 0 Lives, they should be automatically banned from the server.

Players should not gain Lives by killing other players. Players should also not be able to craft Maces.

The number of Lives remaining should be displayed above each player's hearts/health bar.
Kodari AI
KodariSep 24 at 10:39 am 1
DragonEggMaceQuest
A Minecraft plugin that initiates a timed PvP event after the Ender Dragon's first death. The first player to obtain the Dragon Egg becomes the target, with a 10-minute countdown displayed on their screen. If another player kills and takes the egg, the timer resets. Upon timer completion, the holder receives two enchanted Maces (Wind Burst III, Density V, Mending, Unbreaking III) that cannot be crafted. This activates a Lives system where every player starts with 10 lives, losing one only when killed by another player. Reaching zero lives triggers an automatic ban. Lives are displayed above each player's health bar.
  1. Create the Gradle project and plugin metadata.

  2. Implement first-dragon-egg ownership, the paused/resettable timer, and mace rewards.

  3. Add the delayed PvP Lives system and block mace crafting.

Created the DragonEggLives plugin with first-dragon-kill tracking, an egg-holder timer that pauses without the egg and resets when ownership changes, two enchanted Maces as the reward, and a PvP-only Lives system that bans players at zero. Mace crafting is blocked.

Lives use Minecraft’s below-name scoreboard display; vanilla scoreboards don’t provide a display slot above the health bar.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
8 410
src/main/java/com/kodari/dragonlives/DragonEggLivesPlugin.java
package com.kodari.dragonlives;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class DragonEggLivesPlugin extends JavaPlugin {
    private LivesManager livesManager;
    private DragonEggManager dragonEggManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        livesManager = new LivesManager(this);
        dragonEggManager = new DragonEggManager(this);

        Bukkit.getPluginManager().registerEvents(livesManager, this);
        Bukkit.getPluginManager().registerEvents(dragonEggManager, this);
        Bukkit.getPluginManager().registerEvents(new MaceCraftListener(), this);

        livesManager.initialize();
        dragonEggManager.start();
    }

    @Override
    public void onDisable() {
        if (dragonEggManager != null) {
            dragonEggManager.saveState();
        }
    }

    public LivesManager getLivesManager() {
        return livesManager;
    }
}