greenville Rp

create me a sword with the name fight sword witch make go 10 block foward

Kodari AI
KodariOct 18 at 1:46 pm 1
LeapStrikeSword
A Minecraft plugin that adds a special sword item called "Fight Sword". When a player uses this sword, it launches them 10 blocks forward in the direction they are facing. The plugin registers a custom item with a unique identifier, handles player interactions, and applies a calculated velocity vector based on the player's current yaw angle to propel them forward. It includes proper event handling for right-click actions, cooldown management to prevent spam, and configurable launch distance. The sword can be obtained via a simple command and integrates seamlessly with the game's physics system.
  • Create a /fightsword command that gives the custom sword.

  • Make right-click dash the wielder forward up to 10 blocks, stopping short of blocks.

  • Register the command and interaction listener in the plugin entry point.

Created the Fight Sword plugin. Use /fightsword to get the sword, then right-click to dash up to 10 blocks in the direction you’re looking; blocks stop the dash. The command is OP-only by default.

greenville Rp

it bac be use by shift attack button

Kodari AI
KodariOct 18 at 1:46 pm 1

Fight Sword now dashes when you sneak (hold Shift) and left-click.

greenville Rp

ok now give me the download

Kodari AI
KodariOct 18 at 1:46 pm 1

On desktop, click Compile in the top bar. On your phone, tap ⋮ → Compile Project. Then click Compile in the window; when it succeeds, click Download to get the plugin JAR.

greenville Rp

makae it a mod to

Kodari AI
KodariOct 18 at 1:47 pm 1

Which mod loader and Minecraft version should I target—Fabric, Forge, or NeoForge? A mod is a separate project type from this Bukkit plugin.

greenville Rp

fabric

Kodari AI
KodariOct 18 at 1:47 pm 1

Which Minecraft version should the Fabric mod target (for example, 1.20.1 or 1.21.4)?

Kodari can make mistakes. Review important code before using.
Files
src
Code
3 108
src/main/java/com/kodari/fightsword/FightSwordPlugin.java
package com.kodari.fightsword;

import java.util.HashMap;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class FightSwordPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        FightSwordListener swordListener = new FightSwordListener(this);
        getServer().getPluginManager().registerEvents(swordListener, this);
        getCommand("fightsword").setExecutor((CommandSender sender, Command command, String label, String[] args) -> {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can use this command.");
                return true;
            }

            HashMap<Integer, ItemStack> leftovers = player.getInventory().addItem(swordListener.createSword());
            leftovers.values().forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
            player.sendMessage(ChatColor.GREEN + "You received the Fight Sword!");
            return true;
        });
    }
}