frostyishere_.

WARBOUND — Complete Minecraft Plugin

Create a WARBOUND plugin for a Minecraft Paper server.

Core Warbound System

When a player joins the server for the first time:

  • Give them exactly 1 random Warbound.
  • Save the Warbound permanently to their player data.
  • When they leave and rejoin, do NOT give them another Warbound.
  • Server restarts must not reset their Warbound.
  • Each player can have only one active Warbound.

First Join

First Join → Check player data → No Warbound found → Give 1 random Warbound → Save Warbound

Rejoin

Player rejoins → Check player data → Warbound already exists → Give nothing

⚔️ Warbound Abilities

Every Warbound has 2 unique abilities.

Controls

  • Right Click → Ability 1
  • Shift + Right Click → Ability 2

Every ability should have:

  • Custom cooldown
  • Custom damage/effects
  • Custom particles
  • Custom sounds
  • Configurable values in "config.yml"

🪙 25 Warbounds & Abilities

🔥 Inferno

  • Right Click: Flame Burst
  • Shift + Right Click: Inferno Dash

❄️ Frost

  • Right Click: Frost Blast
  • Shift + Right Click: Ice Prison

⚡ Storm

  • Right Click: Lightning Strike
  • Shift + Right Click: Thunder Dash

🌍 Terra

  • Right Click: Earth Shockwave
  • Shift + Right Click: Stone Guard

🌊 Aqua

  • Right Click: Water Blast
  • Shift + Right Click: Tidal Wave

🌪️ Gale

  • Right Click: Wind Burst
  • Shift + Right Click: Wind Dash

🌿 Nature

  • Right Click: Nature Heal
  • Shift + Right Click: Root Trap

🌋 Magma

  • Right Click: Magma Burst
  • Shift + Right Click: Lava Dash

🌑 Void

  • Right Click: Void Blast
  • Shift + Right Click: Void Teleport

🖤 Shadow

  • Right Click: Shadow Strike
  • Shift + Right Click: Shadow Step

🌘 Eclipse

  • Right Click: Eclipse Blast
  • Shift + Right Click: Dark Veil

🕳️ Abyss

  • Right Click: Abyss Pull
  • Shift + Right Click: Abyss Rift

👻 Phantom

  • Right Click: Phantom Strike
  • Shift + Right Click: Phantom Dash

✨ Celestial

  • Right Click: Starfall
  • Shift + Right Click: Celestial Shield

☀️ Divine

  • Right Click: Divine Blast
  • Shift + Right Click: Divine Protection

🌌 Astral

  • Right Click: Astral Beam
  • Shift + Right Click: Astral Shift

♾️ Eternal

  • Right Click: Eternal Strike
  • Shift + Right Click: Time Barrier

🌀 Chaos

  • Right Click: Chaos Burst
  • Shift + Right Click: Chaos Swap

🌠 Cosmic

  • Right Click: Cosmic Beam
  • Shift + Right Click: Meteor Crash

🏛️ Ancient

  • Right Click: Ancient Blast
  • Shift + Right Click: Ancient Guard

🩸 Blood

  • Right Click: Blood Strike
  • Shift + Right Click: Blood Rush

👁️ Soul

  • Right Click: Soul Drain
  • Shift + Right Click: Soul Step

🗿 Titan

  • Right Click: Titan Smash
  • Shift + Right Click: Titan Strength

🐉 Dragon

  • Right Click: Dragon Breath
  • Shift + Right Click: Dragon Flight

👑 War King

  • Right Click: Royal Strike
  • Shift + Right Click: War Dominion

🎨 Custom Warbound Items

Warbound must be a completely custom item.

  • Do NOT retexture any existing Minecraft block.
  • Do NOT replace the texture of an existing Minecraft item.
  • Use a custom resource-pack model/texture for Warbound.
  • Every Warbound should have its own unique model and appearance.
  • The item should have a custom display name and lore.

💾 Player Data

Save:

  • Player UUID
  • Current Warbound
  • First-join reward status
  • Ability cooldowns when necessary

Player data must survive:

  • Server restart
  • Disconnect
  • Reconnect

🛠️ Admin Commands

/warbound give <player> <warbound> /warbound random <player> /warbound remove <player> /warbound info <player> /warbound reload

Add proper permission nodes for admin commands.

⚙️ Configuration

Everything important should be configurable through "config.yml", including:

  • Ability cooldowns
  • Ability damage
  • Ability range
  • Ability duration
  • Potion effects
  • First-join settings
  • Warbound settings
  • Messages
  • Sounds
  • Particles

🔥 Main Rule

ONE PLAYER = ONE AUTOMATIC WARBOUND

A player receives exactly one random Warbound on their first-ever join.

Rejoining, reconnecting, changing worlds, dying, or restarting the server must never automatically give another Warbound.

The main gameplay mechanic is:

First Join → Random Warbound → Permanent Warbound → 2 Abilities → Right Click Combat System paper 1.21.11

Kodari AI
KodariAug 17 at 5:42 am 3
Warbound
A Minecraft Paper plugin that assigns each player one permanent random Warbound on their first join, granting them two unique combat abilities. Right-click triggers Ability 1, shift-right-click triggers Ability 2, each with configurable cooldowns, damage, particles, and sounds. Features 25 distinct Warbounds with custom resource-pack models, persistent player data storage, admin commands for management, and a fully configurable config.yml for balancing all gameplay elements.
  1. Create the Paper 1.21.11 Gradle project and plugin metadata.

  2. Add the permanent one-Warbound player data system and custom model item factory.

  3. Add all 25 Warbounds, their 50 abilities, configurable combat effects, cooldowns, particles, and sounds.

  4. Add interaction handling, admin commands, permissions, configuration, and a resource-pack model scaffold.

  1. Created a complete Paper 1.21.11 Warbound plugin project with Gradle configuration and plugin metadata.

  2. Added permanent UUID-based player data storage in individual YAML files, including Warbound assignment, first-join status, and cooldowns.

  3. Implemented all 25 Warbounds and 50 abilities with configurable cooldowns, damage, range, duration, particles, sounds, and effects.

  4. Added right-click and shift-right-click combat controls, target handling, dashes, teleports, shields, healing, area attacks, and cooldown feedback.

  5. Added /warbound give, random, remove, info, and reload commands with permission nodes and tab completion.

  6. Added custom model-data item handling and a resource-pack model scaffold with unique model paths for every Warbound.

Resource-pack artwork PNGs still need to be supplied under resource-pack/assets/warbound/textures/item/; the plugin and model routing are already prepared for them.

Kodari can make mistakes. Review important code before using.
Files
resource-pack
src
build.gradle
manifest.kod
settings.gradle
Code
41 820
src/main/java/com/kodari/warbound/AbilityEngine.java
package com.kodari.warbound;

import com.cryptomorin.xseries.particles.XParticle;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Comparator;

public class AbilityEngine {
    private final WarboundPlugin plugin;
    private final PlayerDataManager dataManager;

    public AbilityEngine(WarboundPlugin plugin, PlayerDataManager dataManager) {
        this.plugin = plugin;
        this.dataManager = dataManager;
    }

    public void cast(Player player, Warbound warbound, Ability ability) {
        PlayerData data = dataManager.load(player.getUniqueId());
        long now = System.currentTimeMillis();
        String key = ability.getId();
        long readyAt = data.getCooldowns().getOrDefault(key, 0L);
        ConfigurationSection section = section(warbound, ability);
        int cooldown = section.getInt("cooldown", ability.getCooldown());
        if (readyAt > now) {
            long seconds = Math.max(1, (readyAt - now + 999) / 1000);
            plugin.sendMessage(player, "cooldown", "%seconds%", String.valueOf(seconds));
            return;
        }
        data.getCooldowns().put(key, now + cooldown * 1000L);
        dataManager.save(data);
        double range = section.getDouble("range", ability.getRange());
        double damage = section.getDouble("damage", ability.getDamage());
        int duration = section.getInt("duration", ability.getDuration());
        playEffects(player, section, ability);
        execute(player, ability, range, damage, duration, section);
    }

    private ConfigurationSection section(Warbound warbound, Ability ability) {
        return plugin.getConfig().getConfigurationSection("abilities." + warbound.getId() + "." + ability.getId());
    }

    private void playEffects(Player player, ConfigurationSection section, Ability ability) {
        String particle = section.getString("particle", ability.getParticle());
        int count = plugin.getConfig().getInt("settings.ability-particle-count", 24);
        double offset = plugin.getConfig().getDouble("settings.ability-particle-offset", 0.35);
        XParticle.of(particle).ifPresent(p -> player.getWorld().spawnParticle(p.get(), player.getLocation().add(0, 1, 0), count, offset, offset, offset, 0.02));
        XSound.matchXSound(section.getString("sound", ability.getSound())).ifPresent(sound -> sound.play(player));
    }

    private void execute(Player player, Ability ability, double range, double damage, int duration, ConfigurationSection section) {
        Ability.Action action = ability.getAction();
        LivingEntity target = findTarget(player, range);
        switch (action) {
            case BURST, SHOCKWAVE, METEOR, DOMINION -> damageNearby(player, range, damage);
            case DASH -> dash(player, range, damage);
            case FREEZE, PRISON -> { if (target != null) { damage(target, player, damage); applyEffect(target, section, duration); } }
            case LIGHTNING -> { if (target != null) { target.getWorld().strikeLightningEffect(target.getLocation()); damage(target, player, damage); applyEffect(target, section, duration); } }
            case GUARD, SHIELD -> applyEffect(player, section, duration);
            case BLAST, BEAM -> { if (target != null) { damage(target, player, damage); applyEffect(target, section, duration); } }
            case KNOCKBACK -> { if (target != null) { damage(target, player, damage); target.setVelocity(player.getLocation().getDirection().normalize().multiply(1.4).setY(0.5)); applyEffect(target, section, duration); } }
            case HEAL -> { player.setHealth(Math.min(player.getAttribute(org.bukkit.attribute.Attribute.MAX_HEALTH).getValue(), player.getHealth() + Math.max(2, damage == 0 ? 6 : damage))); applyEffect(player, section, duration); }
            case TELEPORT -> teleport(player, range);
            case VEIL -> applyEffect(player, section, duration);
            case PULL -> { if (target != null) { damage(target, player, damage); target.setVelocity(player.getLocation().toVector().subtract(target.getLocation().toVector()).normalize().multiply(1.2)); applyEffect(target, section, duration); } }
            case RIFT -> { damageNearby(player, range, damage); teleport(player, range / 2); }
            case SWAP -> { if (target != null) { Location targetLocation = target.getLocation().clone(); target.teleport(player.getLocation()); player.teleport(targetLocation); damage(target, player, damage); applyEffect(target, section, duration); } }
            case DRAIN -> { if (target != null) { damage(target, player, damage); player.setHealth(Math.min(player.getAttribute(org.bukkit.attribute.Attribute.MAX_HEALTH).getValue(), player.getHealth() + damage / 2)); applyEffect(target, section, duration); } }
            case STRENGTH -> applyEffect(player, section, duration);
            case FLIGHT -> { applyEffect(player, section, duration); XPotion.matchXPotion("SLOW_FALLING").map(x -> x.buildPotionEffect(duration * 20, 0)).ifPresent(player::addPotionEffect); }
            case BREATH -> { damageNearby(player, range, damage); for (Entity entity : player.getNearbyEntities(range, range, range)) if (entity instanceof LivingEntity living && living != player) applyEffect(living, section, duration); }
        }
    }

    private LivingEntity findTarget(Player player, double range) {
        if (range <= 0) return null;
        Vector direction = player.getEyeLocation().getDirection().normalize();
        return player.getNearbyEntities(range, range, range).stream().filter(entity -> entity instanceof LivingEntity && entity != player)
                .map(entity -> (LivingEntity) entity)
                .filter(entity -> entity.getLocation().distanceSquared(player.getLocation()) <= range * range)
                .filter(entity -> direction.dot(entity.getEyeLocation().toVector().subtract(player.getEyeLocation().toVector()).normalize()) > 0.45)
                .min(Comparator.comparingDouble(entity -> entity.getLocation().distanceSquared(player.getLocation()))).orElse(null);
    }

    private void damageNearby(Player player, double range, double damage) {
        if (damage <= 0) return;
        for (Entity entity : player.getNearbyEntities(range, range, range)) if (entity instanceof LivingEntity living && living != player) damage(living, player, damage);
    }

    private void damage(LivingEntity target, Player source, double amount) { if (amount > 0) target.damage(amount, source); }

    private void dash(Player player, double range, double damage) {
        Vector direction = player.getLocation().getDirection().normalize();
        player.setVelocity(direction.multiply(Math.min(2.5, Math.max(1, range / 3))).setY(0.35));
        plugin.getServer().getScheduler().runTaskLater(plugin, () -> damageNearby(player, Math.min(4, range / 2), damage), 8L);
    }

    private void teleport(Player player, double range) {
        Location destination = player.getLocation().clone().add(player.getLocation().getDirection().normalize().multiply(Math.max(2, Math.min(8, range))));
        destination.setY(player.getWorld().getHighestBlockYAt(destination) + 1);
        if (destination.getBlock().getType().isAir()) player.teleport(destination);
    }

    private void applyEffect(LivingEntity entity, ConfigurationSection section, int duration) {
        String effect = section.getString("effect", "");
        if (effect.isEmpty() || effect.equalsIgnoreCase("BURNING")) {
            if (effect.equalsIgnoreCase("BURNING")) entity.setFireTicks(duration * 20);
            return;
        }
        int amplifier = section.getInt("effect-amplifier", 0);
        XPotion.matchXPotion(effect).map(potion -> potion.buildPotionEffect(duration * 20, amplifier)).ifPresent(entity::addPotionEffect);
    }
}