K

preferably have a custom shortened command called /blood dagger

📎 1 file 1,451 chars
📄
pasted-code-1773509615882.txt
txt 33 lines
▶
Plugin Name: BloodDagger
Item: A dark blood-magic dagger that channels the power of sacrificed souls.
Abilities:
1. 🩸 Blood Inferno (Shift + F)
Launches a massive blood-infused fireball that explodes on impact, dealing massive damage and leaving a ring of fire. Screams with a ghast sound on cast.

Cooldown: 25 seconds

2. 🩸 Crimson Surge (Shift + Right Click)
Launches the player forward at high speed in the direction they're looking, leaving a blood particle trail. Any enemy they pass through takes massive knockback and damage.

Cooldown: 15 seconds

3. 🩸 Soul Drain (Hold sneak for 3 seconds while holding the dagger)
Drains the life force of all nearby enemies within 8 blocks, stealing their health and giving it to the player. Plays a wither sound.

Cooldown: 40 seconds


Implementation instructions:

Use PlayerSwapHandItemsEvent for Blood Inferno
Use PlayerInteractEvent for Crimson Surge
Use BukkitRunnable repeating task to detect sneak-hold for Soul Drain
Detect the item using PersistentDataContainer with a custom key blood_dagger:true
Store cooldowns in a HashMap per ability
Give command:

/give @s minecraft:stick[minecraft:item_model="fortify:blood_dagger",minecraft:custom_data={blood_dagger:1b}]

Cancel all events so abilities don't trigger vanilla behavior
Add particle effects (REDSTONE, red color) on every ability
Use Folia-compatible scheduling (RegionScheduler / AsyncScheduler) instead of BukkitScheduler
Kodari AI
KodariMar 14 at 5:39 pm 20,905 (v2)

I’ll create a BloodDagger plugin with three powerful blood-magic abilities and Folia-compatible scheduling.

BloodDagger
A dark blood-magic dagger plugin featuring three devastating abilities: Blood Inferno (explosive fireball), Crimson Surge (high-speed dash attack), and Soul Drain (life-stealing aura). Uses Folia-compatible scheduling and PersistentDataContainer for item identification. Players activate abilities through unique combinations of shift, right-click, and item-swap interactions.

Now I’ll create the complete BloodDagger plugin with Folia-compatible scheduling.

Now I need to fix a missing import I noticed:

All files created. BloodDagger plugin with three blood-magic abilities using Folia-compatible scheduling, PersistentDataContainer item detection, and cooldown management. Use /blood dagger to obtain the weapon.

K

Problem 1 — Wrong model data system The plugin uses setCustomModelData(1) (old 1.20 system). For 1.21.4+ you need to set minecraft:item_model component instead. Fix in BloodCommand.java, replace: javameta.setCustomModelData(1); with: javameta.setItemModel(new NamespacedKey("fortify", "blood_dagger")); Problem 2 — No attack damage It's a stick with no attributes. Add this to giveBloodDagger(): javameta.addAttributeModifier( Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier( new NamespacedKey(plugin, "blood_dagger_damage"), 8.0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.MAINHAND ) );

code

**Problem 3 — Wrong API version**
`build.gradle` is targeting `spigot-api:1.21` but you're on 1.21.11. Change it to:
compileOnly 'io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT'

Kodari AI
KodariMar 14 at 6:43 pm 8,701 (v2)

I’ll read the relevant files to understand the current implementation and apply the fixes.

I’ll apply all three fixes now.

Plan:

  1. Fix BloodCommand.java - replace CustomModelData with ItemModel and add attack damage attribute

  2. Fix build.gradle - update to Paper API 1.21.1

All three issues fixed:

  • Replaced CustomModelData with ItemModel using NamespacedKey for 1.21.4+ compatibility

  • Added GENERIC_ATTACK_DAMAGE attribute with 8.0 damage for main hand

  • Updated build.gradle to use Paper API 1.21.1

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
12 802
src/main/java/com/blooddagger/BloodDagger.java
package com.blooddagger;

import com.blooddagger.command.BloodCommand;
import com.blooddagger.listener.DaggerListener;
import com.blooddagger.manager.AbilityManager;
import com.blooddagger.manager.CooldownManager;
import com.tcoded.folialib.FoliaLib;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BloodDagger extends JavaPlugin {
    
    private FoliaLib foliaLib;
    private CooldownManager cooldownManager;
    private AbilityManager abilityManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.foliaLib = new FoliaLib(this);
        this.cooldownManager = new CooldownManager();
        this.abilityManager = new AbilityManager(this);
        
        Bukkit.getPluginManager().registerEvents(new DaggerListener(this), this);
        
        getCommand("blood").setExecutor(new BloodCommand(this));
        
        getLogger().info("BloodDagger has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (foliaLib != null) {
            foliaLib.getScheduler().cancelAllTasks();
        }
        getLogger().info("BloodDagger has been disabled!");
    }
}