Kote Kore

Create me a 1.21.11 Plugin paper or Pluto to nerf carts my last time i did it wioth skript it was

on damage of player: if damage cause is entity explosion: if attacker is set: if attacker is a minecart: set damage to 22 to make it max 6 hearts damage

Kodari AI
KodariOct 13 at 6:01 pm 1
CartDamageNerf
CartDamageNerf is a Paper 1.21.11 plugin that limits damage dealt to players by minecarts. When a player takes damage from a minecart entity explosion, the plugin caps the damage at 6 hearts (12 health points). The plugin listens for EntityDamageByEntityEvent, checks if the damager is a minecart, and applies the damage cap. It uses a simple configuration file to allow server admins to adjust the maximum damage value without recompiling. The plugin is lightweight, has no external dependencies, and registers a single event listener on enable. It also includes a reload command for configuration changes and proper plugin.yml setup with API version targeting.

I’ll build this as a Paper 1.21.11 plugin. It listens for minecart explosion damage to players and caps it at 12 damage (6 hearts), with the cap set in config.yml.

The NerfCarts plugin is created for Paper 1.21.11.

  • Listener: MinecartExplosionListener catches player damage from a minecart explosion and caps it at max-damage. It only lowers damage that is above the cap, so smaller hits are unchanged. Your Skript set a flat 22, but since you asked for a maximum of 6 hearts, this uses a cap instead.

  • Config: config.yml sets max-damage: 12.0 (6 hearts) and enabled: true. Change the number to adjust the cap, or set enabled to false to turn it off without removing the plugin.

  • Files: NerfCartsPlugin.java loads the config and registers the listener. plugin.yml, build.gradle and settings.gradle are included.

To get the jar, click Compile in the top bar, then Download on the successful build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 90
src/main/java/com/kodari/nerfcarts/NerfCartsPlugin.java
package com.kodari.nerfcarts;

import org.bukkit.plugin.java.JavaPlugin;

public class NerfCartsPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new MinecartExplosionListener(this), this);
        getLogger().info("NerfCarts enabled. Minecart explosion damage cap: " + getConfig().getDouble("max-damage", 12.0));
    }
}