lulger

i want a plugin for a server that when u join for the first time it lets u choose a main weapon any1 including non ops can use /pickpower but can only use it once when u do it it opens a INVENTORY GUI that has a few things for abil;itys spear makes u a little faster and gives u a sharpness 6 dia spear that can never break and each maxe one it gives u a dencity 6 mace that is unbreakable and when u right click it launches u up in the air 20 blocks u take no fall damage and if u do that and land next to them it sends them up a little bit but mostly across and then there is sword that gives u a sharp 6 sword that every kill gives you another heart maxing out at 20

Kodari AI
KodariJul 14 at 5:35 am 10
PickPower
PickPower lets each player choose one permanent main weapon through an inventory GUI. Players can select a speed-enhancing Diamond Spear, an unbreakable Density Mace that launches its wielder and knocks back nearby players on landing, or a Sharpness Sword that grants an additional heart for every kill up to twenty hearts. The /pickpower command is available to everyone and becomes unavailable after a choice is saved.
  • Adds a one-time weapon selection menu on first join and through /pickpower.

  • Provides spear, mace, and sword abilities with persistent player choices.

  • Stores choices and sword heart progression in a YAML data file.

  • Uses XSeries for cross-version materials, enchantments, attributes, and potion effects.

lulger

make when u land it makes a slam sound and make the mace have windburst 1 when u dahs up with mace make it go faster and also make some red particles when u go up

Kodari AI
KodariJul 14 at 5:42 am 4
  1. Update the mace item and launch effect.

  2. Add slam sound, faster launch, and red upward particles.

  • Increased the mace launch from 1.8 to 2.4 velocity.

  • Added Wind Burst I to the mace.

  • Added red particles while launching.

  • Added a slam sound when landing.

lulger

make the spear have lunge and make it actually a miencrtaft spear not a sword named spear they got added to minecraft also the mace let u infinetly fly make it have a 10 second cooldown after u use the ability

Kodari AI
KodariJul 14 at 5:50 am 6
  1. Update the spear item to use the Minecraft spear material and Lunge enchantment.

  2. Add a 10-second per-player cooldown to the mace launch ability.

  3. Preserve the existing launch particles, slam sound, and Wind Burst behavior.

  • Spear now uses the Minecraft DIAMOND_SPEAR material when available, with a diamond sword fallback on older versions.

  • Added Lunge I and kept Sharpness VI plus Unbreakable.

  • Mace launch now has a 10-second cooldown per player.

  • Cooldowns are cleared when players leave the server.

lulger

is there currently a command to remove a power

Kodari AI
KodariJul 14 at 5:54 am 1

No. The plugin currently only has /pickpower (and /power), which lets a player choose their power once. There is no command to remove or reset a power.

lulger

make a command that only ops can use /power remove username and then it lets them rechoose only when the command is used on them

Kodari AI
KodariJul 14 at 5:59 am 10
  1. Add an operator-only /power remove <username> subcommand that resets the target player’s choice.

  2. Update command registration and tab completion so the reset command is discoverable.

Added /power remove <username>.

  • Only operators can use it.

  • Removes the target’s saved power and custom weapon.

  • Resets their speed or extra-heart effects.

  • Immediately opens the weapon-selection GUI so they can choose again.

  • Added tab completion for remove and online player names.

Usage:

Plain Text
/power remove PlayerName
lulger

make it lunge 3 and if u die u keep the weapon

Kodari AI
KodariJul 14 at 6:22 am 8
  1. Change the spear’s Lunge enchantment to level III.

  2. Make selected weapons persist through player death.

  • Spear now has Lunge III.

  • Selected weapons are preserved when the player dies and restored after respawn.

  • The preserved weapon is removed from the death drops so other players cannot pick it up.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 904
src/main/java/com/kodari/pickpower/PickPowerPlugin.java
package com.kodari.pickpower;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;

public class PickPowerPlugin extends JavaPlugin {
    private PlayerDataStore dataStore;
    private ItemFactory itemFactory;
    private PowerListener powerListener;
    private final Map<Inventory, WeaponSelectionGUI> openMenus = new HashMap<>();

    @Override
    public void onEnable() {
        this.dataStore = new PlayerDataStore(this);
        this.itemFactory = new ItemFactory(this);
        this.powerListener = new PowerListener(this, dataStore, itemFactory);

        getServer().getPluginManager().registerEvents(powerListener, this);
        getServer().getPluginManager().registerEvents(new GUIListener(this), this);
        PickPowerCommand command = new PickPowerCommand(this);
        getCommand("pickpower").setExecutor(command);
        getCommand("pickpower").setTabCompleter(command);
    }

    @Override
    public void onDisable() {
        dataStore.save();
        openMenus.clear();
    }

    public PlayerDataStore getDataStore() {
        return dataStore;
    }

    public void openWeaponMenu(Player player) {
        if (dataStore.hasPicked(player.getUniqueId())) {
            player.sendMessage(ChatColor.RED + "You have already chosen your main weapon.");
            return;
        }

        WeaponSelectionGUI menu = new WeaponSelectionGUI(itemFactory);
        openMenus.put(menu.getInventory(), menu);
        player.openInventory(menu.getInventory());
    }

    public WeaponSelectionGUI getMenu(Inventory inventory) {
        return openMenus.get(inventory);
    }

    public void removePower(Player player) {
        PowerType previousPower = dataStore.getPower(player.getUniqueId());
        dataStore.reset(player.getUniqueId());

        if (previousPower != null) {
            for (int slot = 0; slot < player.getInventory().getSize(); slot++) {
                ItemStack item = player.getInventory().getItem(slot);
                if (itemFactory.getPower(item) == previousPower) {
                    player.getInventory().setItem(slot, null);
                }
            }
            powerListener.resetPlayer(player, previousPower);
        }

        player.closeInventory();
        openWeaponMenu(player);
    }

    public void closeMenu(Inventory inventory) {
        openMenus.remove(inventory);
    }

    public void chooseWeapon(Player player, Inventory inventory, PowerType powerType) {
        WeaponSelectionGUI menu = openMenus.remove(inventory);

        if (menu == null || dataStore.hasPicked(player.getUniqueId())) {
            player.closeInventory();
            return;
        }

        dataStore.pick(player.getUniqueId(), powerType);

        ItemStack weapon = itemFactory.create(powerType);
        Map<Integer, ItemStack> leftovers = player.getInventory().addItem(weapon);
        leftovers.values().forEach(item ->
                player.getWorld().dropItemNaturally(player.getLocation(), item));

        powerListener.refreshPlayer(player);

        player.sendMessage(ChatColor.GREEN + "You chose the "
                + ChatColor.YELLOW + powerType.name().toLowerCase() + ChatColor.GREEN + " power.");
        player.closeInventory();
    }
}