greatlarp_

make a plugin for minecraft like dash sword warden beam and thunder strike make thunder deal 2.5 dmg to any heart and warden 3 dash mace distance 9block

Kodari AI
KodariOct 5 at 12:15 pm 1
DashWardenCombat
Creates a Minecraft combat plugin featuring a dash sword ability that propels players 9 blocks forward with mace-like impact. Implements a Warden mode granting enhanced combat capabilities with 3x damage multiplier. Includes a devastating thunder strike ability that calls lightning from the sky, dealing 2.5 damage per heart to all affected entities. Players can toggle between dash sword and warden forms, with cooldowns and visual effects for each ability. Designed for PvP and PvE combat scenarios, offering strategic depth through ability management and positioning.

[Generation stopped]

greatlarp_

dont make it like mace make it so when u click F it uses ability add custm craft recipe

Kodari AI
KodariOct 5 at 12:19 pm 1

Plan:

  • Create the Paper plugin scaffold and register three custom weapon recipes.

  • Bind each weapon’s ability to F: a 9-block dash, a 3-damage Warden beam, or a 2.5-damage thunder strike.

Created DashWardenCombat. Press F (swap hands) while holding a custom weapon to use its ability:

  • Dash Sword: dashes up to 9 blocks forward, stopping short of walls.

  • Warden Blade: fires a beam that deals 3 damage.

  • Thunder Blade: calls a visual lightning strike on the targeted entity for 2.5 damage.

Each weapon has its own crafting recipe, and F won’t swap your held item when one is activated.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 218
src/main/java/com/kodari/dashwarden/DashWardenPlugin.java
package com.kodari.dashwarden;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.List;
import java.util.Map;

public final class DashWardenPlugin extends JavaPlugin {
    private NamespacedKey weaponKey;

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "weapon_type");
        registerRecipes();
        getServer().getPluginManager().registerEvents(new AbilityListener(this, weaponKey), this);
    }

    private void registerRecipes() {
        addRecipe("dash_sword", createWeapon("dash_sword", "Dash Sword", "Press F to dash up to 9 blocks."),
                new String[]{" F ", " F ", " S "}, Map.of('F', "FEATHER", 'S', "DIAMOND_SWORD"));
        addRecipe("warden_blade", createWeapon("warden_blade", "Warden Blade", "Press F to fire a 3-damage beam."),
                new String[]{" S ", " C ", " E "}, Map.of('S', "DIAMOND_SWORD", 'C', "SCULK_CATALYST", 'E', "ECHO_SHARD"));
        addRecipe("thunder_blade", createWeapon("thunder_blade", "Thunder Blade", "Press F to strike for 2.5 damage."),
                new String[]{" S ", " R ", " I "}, Map.of('S', "IRON_SWORD", 'R', "LIGHTNING_ROD", 'I', "COPPER_INGOT"));
    }

    private ItemStack createWeapon(String id, String name, String abilityDescription) {
        ItemStack item = XMaterial.matchXMaterial("NETHERITE_SWORD")
                .map(XMaterial::parseItem)
                .orElseThrow(() -> new IllegalStateException("NETHERITE_SWORD is unavailable"));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.AQUA + name);
        meta.setLore(List.of(ChatColor.GRAY + abilityDescription));
        meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, id);
        item.setItemMeta(meta);
        return item;
    }

    private void addRecipe(String id, ItemStack result, String[] shape, Map<Character, String> ingredients) {
        NamespacedKey key = new NamespacedKey(this, id);
        Bukkit.removeRecipe(key);
        ShapedRecipe recipe = new ShapedRecipe(key, result);
        recipe.shape(shape);
        for (Map.Entry<Character, String> entry : ingredients.entrySet()) {
            Material material = XMaterial.matchXMaterial(entry.getValue())
                    .map(XMaterial::parseMaterial)
                    .orElse(null);
            if (material == null) {
                getLogger().warning("Skipping recipe " + id + ": material " + entry.getValue() + " is unavailable.");
                return;
            }
            recipe.setIngredient(entry.getKey(), material);
        }
        Bukkit.addRecipe(recipe);
    }
}