Subhan

can you create a mod with that auto maticly swapped my sword with mace and lets me lunge swap with my spear i want a gui that lets mje choose options create any option you think i could use for my mace like eauto trident mace auto breach swap i want it to be a button to decable auto mace whitch swapps my sward or axe to my mace

Kodari AI
KodariOct 31 at 2:04 pm 1
MaceCombatSuite
A Minecraft plugin providing an automated combat loadout system. Players can toggle Auto-Mace mode via a GUI button, which automatically swaps their sword or axe to a mace when conditions are met. Features include auto trident-mace swap for aerial lunges, auto breach swap to break blocks before mace strikes, and a customizable GUI allowing players to configure various combat options like fall-damage boost timing, target distance thresholds, and cooldown management. The plugin intelligently manages inventory slots, ensuring seamless weapon transitions during PvP and PvE encounters.
  1. Create the Paper plugin scaffold and configurable defaults.

  2. Add a GUI for Auto Mace, spear lunge swap, trident swap, Breach preference, and weapon restore.

  3. Implement the automatic hotbar swaps and safe restoration behavior.

Created the WeaponSwap plugin. Use /weaponswap to open the settings GUI.

  • Auto Mace swaps your sword or axe to a mace while falling, then restores your weapon when you land.

  • Spear Lunge Swap lunges and briefly swaps to a spear or trident when you right-click while sprinting with a sword or axe.

  • Auto Trident swaps to a trident or spear while you’re in water.

  • Auto Breach prefers a mace enchanted with Breach.

  • Restore Weapon toggles returning to your previous hotbar slot after a swap.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 357
src/main/java/com/kodari/weaponswap/WeaponSwapPlugin.java
package com.kodari.weaponswap;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class WeaponSwapPlugin extends JavaPlugin implements CommandExecutor {
    private SwapGui swapGui;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        swapGui = new SwapGui(this);
        getServer().getPluginManager().registerEvents(swapGui, this);
        getServer().getPluginManager().registerEvents(new WeaponSwapListener(this), this);
        getCommand("weaponswap").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player player) {
            swapGui.open(player);
        } else {
            sender.sendMessage("This command can only be used by a player.");
        }
        return true;
    }

    public boolean optionEnabled(String option) {
        return getConfig().getBoolean("options." + option, false);
    }

    public void setOption(String option, boolean enabled) {
        getConfig().set("options." + option, enabled);
        saveConfig();
    }
}