Ashu Kumar
πŸ“Ž 1 file 3,722 chars
πŸ“„
pasted-code-1794032806527.txt
txt 115 lines
β–Ά
# Plugin Development Prompt – Ground Mace Ability

Create a Minecraft Paper plugin named **GroundMace** for Paper 1.21.11 using Java 21 and Maven.

## Main Objective

I already have the original Minecraft Mace weapon with its vanilla smash ability.

I DO NOT want to create a new mace weapon or redesign its existing mechanics.

I only want to modify ONE thing:

**Remove the height/fall-distance requirement from the existing Mace Smash attack.**

Normally, in Minecraft, a player must fall from a certain height while holding a Mace to perform a smash attack. I want the same smash attack to work with a normal left-click hit, even when the attacker is standing on the ground.

## Required Behavior

### 1. Ground Smash
- A player can stand normally on the ground.
- The player holds the original Minecraft MACE.
- The player performs a normal left-click attack on another player.
- The Mace should immediately perform its vanilla-style smash attack.
- No jumping required.
- No falling required.
- No minimum height required.
- No fall distance required.

### 2. Preserve Original Mace Ability

Do not remove or replace the original Mace mechanics.

Keep all existing vanilla Mace features intact, including:
- Original Mace weapon.
- Density enchantment.
- Breach enchantment.
- Wind Burst enchantment.
- Existing weapon attributes.
- Existing item properties.

The only modification should be allowing the smash attack from ground level.

### 3. Original Smash Effects

When the player successfully hits another player using the Mace:

- Trigger the same type of smash impact particles as the vanilla Mace.
- Play the original Mace smash impact sound.
- Apply the vanilla-style smash damage.
- Apply the same type of knockback as a normal Mace smash.
- Make the victim get launched backward/upward.
- Ensure nearby players can see the smash particles and hear the sound.

### 4. Attack Conditions

The ability should work:
- While standing on the ground.
- While jumping.
- While falling.
- While flying, if the player can successfully attack.

The attack should work with a normal left-click hit only.

### 5. Important Restrictions

- Do not require players to jump or gain height.
- Do not require fall distance.
- Do not change the Mace's original attack cooldown unnecessarily.
- Do not modify other weapons.
- Do not trigger the ability when using a sword, axe or other weapon.
- Do not apply damage twice.
- Prevent duplicate main-hand/off-hand attack triggers.
- Do not create artificial fall damage.
- Do not change the original Mace item into a custom weapon.

### 6. Compatibility

- Minecraft Paper 1.21.11.
- Java 21.
- Maven project.
- Use stable Paper/Bukkit APIs wherever possible.
- Avoid NMS and ProtocolLib unless absolutely necessary.
- Ensure compatibility with normal Paper server combat mechanics.

### 7. Configuration

Provide a config.yml with:

- enable-ground-smash: true
- preserve-vanilla-damage: true
- preserve-vanilla-enchantments: true
- smash-particles: true
- smash-sounds: true
- smash-knockback: true

### 8. Commands

/groundmace reload - Reload configuration.
/groundmace info - Show plugin information.

### Final Requirement

The final result should feel exactly like using the normal Minecraft Mace Smash ability, except players no longer need to attack from a height.

**Example:**

Normal Minecraft:
Player jumps from a height β†’ Hits enemy β†’ Mace Smash activates.

My Server:
Player stands on flat ground β†’ Left-clicks enemy with Mace β†’ The same Mace Smash activates immediately.

This is the ONLY gameplay change I want. Keep everything else as close to vanilla Minecraft as possible.

Provide complete source code, plugin.yml, config.yml and a compiled ready-to-use JAR.
Kodari AI
KodariNov 7 at 6:30 am 1
GroundMace
GroundMace is a Paper plugin that removes the height requirement from the vanilla Mace smash attack, allowing players to trigger the smash effect with a normal left-click hit while standing on flat ground. It preserves all original Mace mechanics including Density, Breach, and Wind Burst enchantments, weapon attributes, and item properties. The plugin triggers vanilla-style smash particles, sounds, damage, and knockback on successful hits, works from ground, jumping, falling, or flying states, and prevents duplicate damage or off-hand triggers. It includes configurable options for ground smash, vanilla damage preservation, particles, sounds, and knockback, plus reload and info commands.
  1. Create the Maven/Paper 1.21.11 project and plugin metadata/config.

  2. Add the command and a main-hand-only smash listener that retains vanilla hit damage/enchantments and adds the ground-hit impact.

  3. Keep native fall-based smashes untouched; use Paper/Bukkit APIs without NMS.

Created the GroundMace Maven project with the requested config and /groundmace reload|info commands. Ground-level Mace hits retain the normal hit damage and add smash-style damage, particles, sound, and knockback; existing fall-based smashes are left alone.

Limitation: Paper’s stable API does not expose a way to invoke the actual vanilla Mace smash at zero fall distance. This ground-hit behavior is an approximation, so the native smash damage formula and smash-specific enchantment behavior such as Wind Burst cannot be guaranteed to match vanilla exactly.

To get the JAR: click Compile in the top bar, click Compile in the window, then click Download on the successful build.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
5 196
src/main/java/com/kodari/groundmace/GroundMace.java
package com.kodari.groundmace;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public final class GroundMace extends JavaPlugin {
    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new GroundSmashListener(this), this);
        getCommand("groundmace").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 1) {
            sender.sendMessage("&eUsage: /groundmace <reload|info>");
            return true;
        }

        if (args[0].equalsIgnoreCase("reload")) {
            if (!sender.hasPermission("groundmace.admin")) {
                sender.sendMessage("&cYou do not have permission to reload GroundMace.");
                return true;
            }
            reloadConfig();
            sender.sendMessage("&aGroundMace configuration reloaded.");
            return true;
        }

        if (args[0].equalsIgnoreCase("info")) {
            sender.sendMessage("&6GroundMace &7v" + getDescription().getVersion());
            sender.sendMessage("&7Allows Mace smash-style hits without requiring a fall.");
            return true;
        }

        sender.sendMessage("&eUsage: /groundmace <reload|info>");
        return true;
    }
}