Tristan Butterworth

mace a paper 1.21.11 so mace does 6 hearts max

Kodari AI
KodariOct 10 at 8:46 pm 1
MaceDamageTweaks
Adjusts the vanilla Mace weapon damage in Paper 1.21.11 to a maximum of 6 hearts (12 damage points) per hit. Intercepts melee attacks using the Mace, recalculates damage based on fall distance and configured caps, and applies the modified damage to the target. Includes configurable options for base damage, fall damage multiplier, and maximum damage cap. Provides a simple configuration file for server administrators to fine-tune Mace combat balance without modifying core game files.
  • Create a Paper 1.21.11 Java 21 plugin project.

  • Register a damage listener that caps player mace hits at 12 damage (6 hearts).

  • Add the plugin manifest and Gradle build configuration.

Created a Paper 1.21.11 plugin that caps damage from player-held maces at 12 health points (6 hearts).

Tristan Butterworth

make it no hitting through the shield when you mace them and they are using shield they dont take damage

Kodari AI
KodariOct 23 at 3:34 pm 1

Mace hits against a player who is actively blocking with a shield are now canceled, so they take no damage. The 6-heart damage cap remains for unblocked hits.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 67
src/main/java/com/kodari/macecap/MaceCapPlugin.java
package com.kodari.macecap;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class MaceCapPlugin extends JavaPlugin implements Listener {
    private static final double MAX_DAMAGE = 12.0;

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onEntityDamage(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player attacker)) {
            return;
        }

        if (!"MACE".equals(attacker.getInventory().getItemInMainHand().getType().name())) {
            return;
        }

        if (event.getEntity() instanceof Player defender && defender.isBlocking()) {
            event.setCancelled(true);
            return;
        }

        if (event.getFinalDamage() > MAX_DAMAGE) {
            event.setDamage(MAX_DAMAGE);
        }
    }
}