dindoppoooo

make me an auto mace swap and auto stunslam mod on 1.21.11

Kodari AI
KodariMay 23 at 10:53 pm 5,872 (v2)

I’ll create an auto mace swap and stun slam assistance plugin for Minecraft 1.21.1.

AutoStunSlam
A combat assistance plugin that automatically swaps to a mace and performs smash attacks. Detects when players are falling from height and intelligently switches to a mace in their hotbar for maximum damage. Features configurable fall height thresholds, automatic weapon swapping, and permission-based toggle controls. Perfect for PvP servers wanting enhanced mace combat mechanics.

AutoStunSlam plugin created!

This plugin automatically detects when players are falling and swaps to a mace in their hotbar for devastating smash attacks.

Features:

  • Auto-detects falls of 3+ blocks (configurable)

  • Intelligently swaps to mace during fall

  • Swaps back to original weapon after landing

  • Entity proximity check to avoid wasted swaps

  • /macetoggle command to enable/disable per player

  • Full permission system

  • Debug mode for testing

Config highlights:

  • min-fall-distance: Minimum blocks fallen before auto-swap

  • swap-back-after-landing: Auto-return to previous weapon

  • require-nearby-entity: Only swap if enemies are nearby (prevents wasted swaps)

The plugin tracks fall velocity in real-time and performs frame-perfect weapon swapping for maximum PvP efficiency!

dindoppoooo

bro i mean on 1.21.11 a

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 325
src/main/java/com/autostunslam/AutoStunSlam.java
package com.autostunslam;

import com.autostunslam.command.MaceToggleCommand;
import com.autostunslam.listener.MaceSwapListener;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

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

public class AutoStunSlam extends JavaPlugin {

    private final Map<UUID, Boolean> playerToggles = new HashMap<>();
    private MaceSwapListener maceSwapListener;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        maceSwapListener = new MaceSwapListener(this);
        getServer().getPluginManager().registerEvents(maceSwapListener, this);
        
        getCommand("macetoggle").setExecutor(new MaceToggleCommand(this));
        
        getLogger().info("AutoStunSlam has been enabled!");
    }

    @Override
    public void onDisable() {
        playerToggles.clear();
        getLogger().info("AutoStunSlam has been disabled!");
    }

    public boolean isEnabled(Player player) {
        return playerToggles.getOrDefault(player.getUniqueId(), true);
    }

    public void setEnabled(Player player, boolean enabled) {
        playerToggles.put(player.getUniqueId(), enabled);
    }

    public double getMinFallDistance() {
        return getConfig().getDouble("min-fall-distance", 3.0);
    }

    public boolean shouldSwapBack() {
        return getConfig().getBoolean("swap-back-after-landing", true);
    }

    public int getSwapBackDelay() {
        return getConfig().getInt("swap-back-delay", 10);
    }

    public double getRequireNearbyEntity() {
        return getConfig().getDouble("require-nearby-entity", 5.0);
    }

    public boolean isDebug() {
        return getConfig().getBoolean("debug", false);
    }

    public String getMessage(String key) {
        return getConfig().getString("messages." + key, "");
    }

    public String getPrefix() {
        return getMessage("prefix");
    }
}