zd_shardks

Create a Paper SMP plugin that adds a unique weapon with a deferred damage mechanic. When a player hits another player, the damage is stored and applied after a short delay (e.g. 3 seconds), regardless of distance. Limit stored hits, cancel on attacker death, and add subtle visual effects when damage triggers, name it omnismp author is ZD_Shardks_

Kodari AI
KodariFeb 10 at 10:30 am 8,947 (v2)

I’ll create a Paper SMP plugin with a deferred damage weapon mechanic.

OmniSMP
A Paper SMP plugin featuring a unique weapon with deferred damage mechanics. When players hit each other with this special weapon, damage is stored and applied after a 3-second delay regardless of distance. Includes configurable hit limits, automatic cancellation on attacker death, and visual effects for damage triggers. Perfect for adding strategic depth to PvP combat.

Plugin created successfully! The OmniSMP plugin features:

✅ Deferred Damage Mechanic - Damage stored and applied after 3 seconds ✅ Distance Independent - Damage applies regardless of victim location ✅ Hit Limiting - Max 5 stored hits per victim (configurable) ✅ Death Cancellation - All pending damage cancelled when attacker dies ✅ Visual Effects - Particles and sounds on hit storage and damage trigger ✅ Fully Configurable - Delay, limits, effects, and messages customizable ✅ XSeries Integration - Cross-version compatibility for materials, sounds, and particles

Commands:

  • /omniweapon [player] - Give the Omni Blade weapon

Permissions:

  • omnismp.weapon - Get the weapon (default: op)

  • omnismp.use - Use the weapon’s deferred damage (default: true)

The weapon uses persistent data containers to mark items, so it works with any sword type and maintains its special properties through server restarts.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
.gitignore
build.gradle
settings.gradle
Code
12 496
src/main/java/com/zdshardks/omnismp/OmniSMP.java
package com.zdshardks.omnismp;

import com.zdshardks.omnismp.command.OmniWeaponCommand;
import com.zdshardks.omnismp.listener.PlayerListener;
import com.zdshardks.omnismp.manager.DamageManager;
import com.zdshardks.omnismp.manager.WeaponManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class OmniSMP extends JavaPlugin {
    
    private WeaponManager weaponManager;
    private DamageManager damageManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.weaponManager = new WeaponManager(this);
        this.damageManager = new DamageManager(this);
        
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        
        getCommand("omniweapon").setExecutor(new OmniWeaponCommand(this));
        
        getLogger().info("OmniSMP enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (damageManager != null) {
            damageManager.cancelAll();
        }
        getLogger().info("OmniSMP disabled!");
    }
    
    public String getMessage(String path) {
        String prefix = getConfig().getString("messages.prefix", "&8[&cOmniSMP&8]&r");
        String message = getConfig().getString("messages." + path, "");
        return colorize(prefix + " " + message);
    }
    
    public String colorize(String text) {
        return text.replace("&", "§");
    }
}