shoto_todoroki_mha_rp_irl_17

custom angelic mace that has a healing ability with the command /angelic1 and a double jump ability with the command /angelic 2 both of these have 3 minute cooldowns

Kodari AI
KodariAug 24 at 9:35 pm 1
AngelicMaceAbilities
A Minecraft plugin introducing a custom angelic mace weapon. The mace grants two unique abilities activated via commands. /angelic1 triggers a powerful healing effect, restoring the player's health over time. /angelic2 enables a double jump ability, allowing the player to leap mid-air. Both abilities have a 3-minute cooldown period, tracked per player. The plugin includes command registration, cooldown management, and visual feedback for activation and cooldown status.

I’ll create a Paper plugin with:

  1. A custom PDC-marked angelic mace obtainable via /angelic give.

  2. /angelic1 for full healing with a 3-minute cooldown.

  3. /angelic 2 for a directional double jump with its own 3-minute cooldown.

  4. Cross-version material, sound, and particle handling through XSeries.

Created the Angelic Mace plugin with:

  • Custom PDC-marked Angelic Mace

  • /angelic give [player] to obtain or distribute it

  • /angelic1 healing ability

  • /angelic 2 directional double-jump ability

  • Separate 3-minute cooldowns for both abilities

  • XSeries compatibility for materials, sounds, particles, and attributes

  • Permission: angelicmace.give

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 244
src/main/java/com/kodari/angelicmace/AngelicMacePlugin.java
package com.kodari.angelicmace;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public final class AngelicMacePlugin extends JavaPlugin {
    private static final long COOLDOWN_MILLIS = 180_000L;

    private final Map<UUID, Long> healCooldowns = new HashMap<>();
    private final Map<UUID, Long> doubleJumpCooldowns = new HashMap<>();
    private NamespacedKey maceKey;

    @Override
    public void onEnable() {
        maceKey = new NamespacedKey(this, "angelic_mace");

        AngelicMaceCommand command = new AngelicMaceCommand(this);
        getCommand("angelic1").setExecutor(command);
        getCommand("angelic").setExecutor(command);
    }

    public ItemStack createAngelicMace() {
        ItemStack mace = XMaterial.matchXMaterial("MACE")
                .map(XMaterial::parseItem)
                .orElse(null);
        if (mace == null) {
            mace = XMaterial.matchXMaterial("DIAMOND_SWORD")
                    .map(XMaterial::parseItem)
                    .orElseThrow(() -> new IllegalStateException("No suitable item material is available."));
        }

        ItemMeta meta = mace.getItemMeta();
        meta.setDisplayName(ChatColor.AQUA + "✦ " + ChatColor.WHITE + "Angelic Mace");
        meta.setLore(Arrays.asList(
                ChatColor.GRAY + "A weapon blessed by the heavens.",
                "",
                ChatColor.GREEN + "Healing: " + ChatColor.WHITE + "/angelic1",
                ChatColor.YELLOW + "Double jump: " + ChatColor.WHITE + "/angelic 2"
        ));
        meta.getPersistentDataContainer().set(maceKey, PersistentDataType.BYTE, (byte) 1);
        mace.setItemMeta(meta);
        return mace;
    }

    public boolean isAngelicMace(ItemStack item) {
        if (item == null || !item.hasItemMeta()) {
            return false;
        }
        ItemMeta meta = item.getItemMeta();
        return meta.getPersistentDataContainer().has(maceKey, PersistentDataType.BYTE);
    }

    public void useHealingAbility(Player player) {
        if (!isHoldingMace(player)) {
            player.sendMessage(ChatColor.RED + "You must be holding the Angelic Mace.");
            return;
        }
        if (!checkCooldown(player, healCooldowns)) {
            return;
        }

        AttributeInstance maxHealth = player.getAttribute(
                com.cryptomorin.xseries.XAttribute.of("max_health").map(attribute -> attribute.get()).orElse(null)
        );
        double health = maxHealth == null ? 20.0D : maxHealth.getValue();
        player.setHealth(health);
        player.setFoodLevel(20);
        player.setSaturation(20.0F);
        healCooldowns.put(player.getUniqueId(), System.currentTimeMillis() + COOLDOWN_MILLIS);
        player.sendMessage(ChatColor.AQUA + "The Angelic Mace has restored your health.");
        XSound.matchXSound("ENTITY_PLAYER_LEVELUP").ifPresent(sound -> sound.play(player));
        XParticle.of("HEART").ifPresent(particle -> player.getWorld().spawnParticle(
                particle.get(), player.getLocation().add(0.0D, 1.0D, 0.0D), 12, 0.5D, 0.5D, 0.5D, 0.05D));
    }

    public void useDoubleJumpAbility(Player player) {
        if (!isHoldingMace(player)) {
            player.sendMessage(ChatColor.RED + "You must be holding the Angelic Mace.");
            return;
        }
        if (!checkCooldown(player, doubleJumpCooldowns)) {
            return;
        }

        Vector velocity = player.getLocation().getDirection().normalize().multiply(1.25D);
        velocity.setY(1.0D);
        player.setVelocity(velocity);
        doubleJumpCooldowns.put(player.getUniqueId(), System.currentTimeMillis() + COOLDOWN_MILLIS);
        player.sendMessage(ChatColor.AQUA + "The Angelic Mace launched you into the air.");
        XSound.matchXSound("ENTITY_PHANTOM_FLAP").ifPresent(sound -> sound.play(player));
        XParticle.of("CLOUD").ifPresent(particle -> player.getWorld().spawnParticle(
                particle.get(), player.getLocation(), 18, 0.4D, 0.2D, 0.4D, 0.02D));
    }

    private boolean isHoldingMace(Player player) {
        return isAngelicMace(player.getInventory().getItemInMainHand())
                || isAngelicMace(player.getInventory().getItemInOffHand());
    }

    private boolean checkCooldown(Player player, Map<UUID, Long> cooldowns) {
        long now = System.currentTimeMillis();
        long availableAt = cooldowns.getOrDefault(player.getUniqueId(), 0L);
        if (availableAt > now) {
            long remainingSeconds = (availableAt - now + 999L) / 1000L;
            long minutes = remainingSeconds / 60L;
            long seconds = remainingSeconds % 60L;
            player.sendMessage(ChatColor.RED + "That ability is on cooldown for "
                    + minutes + "m " + seconds + "s.");
            return false;
        }
        return true;
    }
}