notsolgng12
📎 1 file 3,515 chars
📄
pasted-code-1787786507019.txt
txt 104 lines
▶
# Minecraft Plugin: Vortex Lifes

Create a Minecraft Paper/Spigot plugin called **Vortex Lifes**.

## Core Life System

* Every player starts with **10 hearts (10 lives)**.
* Each heart represents **one life**.
* When a player dies, they permanently lose **1 heart/life**.
* The lost heart should be visually represented as being **consumed by a Vortex**.
* After losing a life, the player's maximum health decreases by **1 heart (2 HP)**.
* A player's remaining lives persist through relogging and server restarts.
* Players should never be able to naturally regenerate their lost maximum hearts.

## Deathban

* When a player reaches **0 hearts/lives**, they are permanently **deathbanned**.
* When they die with only **1 heart remaining**, that final heart is consumed by the Vortex and they become deathbanned.
* Deathbanned players cannot join the server.
* Display a message explaining that all of their lives have been consumed by the Vortex.

## Life Display

Make it clearly show how many lives/hearts a player currently has.

### Above the Player's Head

Display the player's remaining lives directly **next to/above their name**, for example:

**PlayerName [10 ♥]**

If they have 7 lives:

**PlayerName [7 ♥]**

If they have 1 life:

**PlayerName [1 ♥]**

The display should update immediately whenever a player gains or loses a life.

## Death Effect

Whenever a player dies:

* Create a dramatic **Vortex effect** around the player's death location.
* The Vortex should visually pull particles inward as if consuming the player's lost heart.
* Play an appropriate dark/magical sound effect.
* Display a message such as:
  **"The Vortex has consumed 1 of your hearts."**
* Show their remaining lives after the death.

Example:

**Before death:** 10 ♥
**Player dies:** Vortex consumes 1 ♥
**After death:** 9 ♥

## Scoreboard / HUD

Also provide an optional HUD display showing:

**Lives: 10 ♥**

This should update automatically whenever the player's life count changes.

## Commands

Add useful admin commands:

* `/lives ` — Shows a player's current number of lives.
* `/setlives  ` — Sets a player's lives.
* `/addlife ` — Gives a player 1 additional life.
* `/removelife ` — Removes 1 life.
* `/revive ` — Removes their deathban and gives them a configurable number of lives.
* `/vortex reload` — Reloads the plugin configuration.

Add appropriate permission nodes for all admin commands.

## Configuration

Create a config file allowing the server owner to customize:

* Starting lives
* Maximum lives
* Deathban message
* Life-loss message
* Vortex particle effects
* Vortex sounds
* Whether the HUD is enabled
* Whether the life counter appears above players
* Messages and formatting

## Important

* Use a reliable persistent storage system so lives and deathbans survive server restarts.
* Prevent players from bypassing the deathban by reconnecting.
* Make sure the maximum health correctly matches the player's current number of lives.
* Make the system compatible with multiplayer servers.
* Ensure the plugin handles players with modified maximum health safely.
* Make the Vortex death effect visually impressive but optimized so it does not cause excessive server lag.
* Provide all required plugin files, including `plugin.yml`, configuration files, and complete Java source code.
* Target the latest stable **Paper Minecraft version**.
Kodari AI
KodariAug 26 at 11:26 pm 3
VortexLives
VortexLives is a Minecraft Paper plugin implementing a permanent life system where each player starts with 10 hearts representing lives. Upon death, players permanently lose one heart, visually consumed by a dramatic vortex particle effect with sound. When reaching zero lives, players become permanently deathbanned with a configurable message. The plugin displays remaining lives above player names and in an optional scoreboard HUD, both updating instantly. Admin commands include /lives, /setlives, /addlife, /removelife, /revive, and /vortex reload with permission nodes. Configuration allows customization of starting/maximum lives, messages, particle effects, sounds, and display toggles. Uses persistent YAML storage ensuring lives and deathbans survive restarts, with automatic maximum health synchronization and multiplayer compatibility.
  1. Create the Gradle/Paper project and plugin metadata.

  2. Add persistent life/deathban storage and configurable life management.

  3. Add vortex effects, overhead life display, action-bar HUD, commands, and event listeners.

  1. Created the Paper 1.21.4 Gradle project with plugin metadata, permissions, commands, and configurable messages.

  2. Added persistent YAML storage for player lives, deathbans, and last-known names.

  3. Implemented life loss on death, maximum-health adjustment, deathban enforcement, revive support, and admin commands.

  4. Added configurable vortex particle/sound effects, above-name life display, and action-bar HUD updates.

  5. Registered join, quit, death, respawn, and login listeners.

notsolgng12

Can you add a LIve that gives 20 hearts and puts a question mark instead of a number above their head.

Kodari AI
KodariSep 12 at 11:50 pm 2

Added a special life system.

  • Added /speciallife <player> with permission vortex.speciallife.

  • The special life grants configurable health, defaulting to 20 hearts.

  • Players with the special life display ? instead of their numeric life count above their head.

  • The special-life state persists through relogging and restarts.

  • The action-bar HUD continues showing the actual configured heart amount.

  • Existing life-setting and revive commands clear the special-life state.

  • Added special-life-hearts: 20 and a configurable success message to config.yml.

Usage:

Plain Text
/speciallife PlayerName
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
13 840
src/main/java/com/kodari/vortexlifes/VortexLifesPlugin.java
package com.kodari.vortexlifes;

import com.kodari.vortexlifes.command.LifeCommand;
import com.kodari.vortexlifes.data.LifeDataStore;
import com.kodari.vortexlifes.display.DisplayManager;
import com.kodari.vortexlifes.effect.VortexEffect;
import com.kodari.vortexlifes.listener.LifeListener;
import com.kodari.vortexlifes.life.LifeManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class VortexLifesPlugin extends JavaPlugin {
    private LifeDataStore dataStore;
    private DisplayManager displayManager;
    private VortexEffect vortexEffect;
    private LifeManager lifeManager;

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

        this.dataStore = new LifeDataStore(this);
        this.displayManager = new DisplayManager(this);
        this.vortexEffect = new VortexEffect(this);
        this.lifeManager = new LifeManager(this, dataStore, displayManager, vortexEffect);

        Bukkit.getPluginManager().registerEvents(new LifeListener(this), this);

        LifeCommand command = new LifeCommand(this);
        registerCommand("lives", command);
        registerCommand("setlives", command);
        registerCommand("addlife", command);
        registerCommand("removelife", command);
        registerCommand("revive", command);
        registerCommand("speciallife", command);
        registerCommand("vortex", command);
    }

    @Override
    public void onDisable() {
        if (dataStore != null) {
            dataStore.save();
        }
        if (displayManager != null) {
            displayManager.clearAll();
        }
    }

    public void reloadPluginConfiguration() {
        reloadConfig();
        lifeManager.refreshAll();
    }

    private void registerCommand(String name, LifeCommand command) {
        PluginCommand pluginCommand = getCommand(name);
        if (pluginCommand != null) {
            pluginCommand.setExecutor(command);
            pluginCommand.setTabCompleter(command);
        }
    }
}