ah3x_
📎 1 file 1,638 chars
📄
pasted-code-1791827713496.txt
txt 42 lines
▶
Copy-Paste AI Prompt
Goal: Create a Fabric/NeoForge mod for Minecraft 1.20+ that introduces a customizable tactical knife system with CS:GO-style animations, custom 3D models, sound effects, and an interactive config GUI.

Core Mechanics:

Items & Models:

Replace/Add custom weapons: Standard Diamond/Netherite Sword, Karambit, and Butterfly Knife.

Base Texture/Skin: Full matte-black CS:GO style finish across all models.

Uses 3D custom models/JSON display states for smooth first-person handling.

Animations & Actions:

Idle Animation: A CS:GO-style trick animation where the knife spins in the player's hand.

Spin Frequency: Customizable timer interval (defaulting to 5–6 seconds between idle spins).

Attack/Hit Animation: When attacking, trigger an immediate stab action followed by a quick trick-spin recovery back to the resting stance.

Incorporate realistic audio cues for blade swinging, opening/flipping, and hitting targets.

GUI & UI System (Keybind: P):

Pressing P opens a custom in-game UI screen.

Weapon Switcher: Toggle active weapon model between Vanilla Sword, Karambit, and Butterfly Knife.

Animation Interval Slider: Adjust the idle spin interval timer anywhere from 1 second up to 10 seconds.

Knife-Specific Controls: Independent timing and animation style toggles for each individual knife model.

Technical Requirements:

Register the keybinding for P (KeyBinding / client tick listener).

Use standard Client-Side render hooks or GeckoLib/AzureLib for custom 3D model display and skeletal keyframe animation playback.

Ensure all UI settings persist locally in a .json config file.

Tips for Best Results
Kodari AI
KodariOct 12 at 5:57 pm 1
TacticalKnifeSystem
A comprehensive Minecraft plugin introducing a customizable tactical knife system with CS:GO-style animations and interactive configuration. Features custom 3D models for Diamond/Netherite Swords, Karambit, and Butterfly Knife with matte-black finishes. Implements idle spin animations with configurable intervals (1-10 seconds), attack animations with stab actions and recovery spins, and realistic audio cues. Includes a keybind (P) to open an in-game GUI for weapon switching, animation interval adjustment, and per-knife control toggles. All settings persist to a local JSON config file. Uses client-side render hooks for smooth first-person handling and skeletal keyframe animation playback, ensuring immersive and responsive gameplay.

This request targets a client-side Fabric/NeoForge mod, not a Bukkit plugin. The P keybind, local config screen, first-person models, and animations can’t be implemented as a server plugin; Fabric/NeoForge mod projects also use Gradle, which conflicts with your Maven-only requirement. I haven’t created a plugin that would only imitate those features.

For the custom 3D knife models, create them in Kodari Studio and bring them into the project through a workspace. Texture generation is disabled for this project; enable it in Settings → Generation, or at https://kodari.ai/settings?tab=features.

Would you like a Maven Bukkit-plugin adaptation instead, or do you want to pursue this as a proper client mod?

ah3x_

i got it

Kodari AI
KodariOct 12 at 6:02 pm 1

For a new Maven project, I can build a Bukkit plugin adaptation. It can provide server-side weapon switching and configurable settings, but not client-side first-person models, trick animations, or a custom keybind UI.

Do you want me to create that Bukkit plugin, or are you aiming for a Fabric/NeoForge client mod?

ah3x_

📄 pasted-code-1791827713496.txt

Kodari AI
KodariOct 12 at 6:10 pm 1
  1. Create a Maven Paper plugin for the server-side subset of the request.

  2. Add /knives, named sword variants, per-weapon interval/style controls, and JSON persistence.

  3. Add timed and combat sound cues; Bukkit cannot provide the client-only P keybind or custom first-person animations/models.

Created a Maven Paper plugin for Java 21 targeting Paper 1.21.11. /knives opens a menu to equip sword-based Vanilla, Karambit, and Butterfly variants, adjust each weapon’s 1–10 second idle cue interval, and toggle its cue. Settings are stored per player in the server’s plugins/TacticalKnives/players.json.

This is a server-side adaptation: Bukkit cannot bind the client’s P key or provide custom first-person models and trick animations. Create the knife models in Kodari Studio and bring them into a client mod project through a workspace. Texture generation is disabled here; enable it in Settings → Generation if you need custom black textures.

ah3x_

veresin 1.21.11

Kodari AI
KodariOct 12 at 6:10 pm 1

Yes—the project targets Paper 1.21.11 and uses Maven (pom.xml). No build.gradle files.

ah3x_

does it work

Kodari AI
KodariOct 12 at 6:20 pm 1

Partially. It’s a Maven Paper plugin targeting Java 21 and Paper 1.21.11. Its server-side features are implemented: /knives opens an inventory menu, equips sword-based variants, saves per-player settings to players.json, and plays timed and hit sound cues.

It does not provide the P keybind, custom first-person models, or real trick animations—the “spin” is represented by a sound cue. I can’t confirm it loads until the project’s compile succeeds.

ah3x_

so

Kodari AI
KodariOct 12 at 6:20 pm 1

So: Maven only—I won’t create any build.gradle files. The plugin is intended for Paper 1.21.11, but whether it builds successfully still needs to be confirmed by compiling the project.

ah3x_

didint work

Kodari AI
KodariOct 12 at 6:23 pm 1

I’ll keep it Maven-only—no build.gradle files. I need to know what failed to fix the right thing: did Maven compilation fail, did the plugin fail to load, or does /knives or a feature not work? Please paste the Maven error or the relevant lines from the server log.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
Code
6 449
src/main/java/com/kodari/tacticalknives/TacticalKnivesPlugin.java
package com.kodari.tacticalknives;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XSound;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public final class TacticalKnivesPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private static final String MENU_TITLE = ChatColor.DARK_GRAY + "Tactical Knives";
    private final Map<UUID, Long> nextIdleCue = new HashMap<>();
    private NamespacedKey weaponKey;
    private PlayerSettingsStore settings;

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "weapon_type");
        settings = new PlayerSettingsStore(this);
        getCommand("knives").setExecutor(this);
        getServer().getPluginManager().registerEvents(this, this);
        getServer().getScheduler().runTaskTimer(this, this::runIdleCues, 20L, 20L);
    }

    @Override
    public void onDisable() {
        if (settings != null) {
            settings.save();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used by a player.");
            return true;
        }
        if (!player.hasPermission("tacticalknives.use")) {
            player.sendMessage(ChatColor.RED + "You do not have permission to use this menu.");
            return true;
        }
        openMenu(player);
        return true;
    }

    @EventHandler
    public void onMenuClick(InventoryClickEvent event) {
        if (!MENU_TITLE.equals(event.getView().getTitle())) {
            return;
        }
        event.setCancelled(true);
        if (!(event.getWhoClicked() instanceof Player player) || event.getRawSlot() >= event.getView().getTopInventory().getSize()) {
            return;
        }

        int slot = event.getRawSlot();
        TacticalWeapon selected = weaponForSelectionSlot(slot);
        if (selected != null) {
            settings.setActiveWeapon(player.getUniqueId(), selected);
            player.getInventory().setItemInMainHand(createWeaponItem(selected));
            playSound("ENTITY_ITEM_PICKUP", player);
            openMenu(player);
            return;
        }

        for (TacticalWeapon weapon : TacticalWeapon.values()) {
            int base = weapon.settingsSlot();
            if (slot == base) {
                settings.setIntervalSeconds(player.getUniqueId(), weapon, settings.getIntervalSeconds(player.getUniqueId(), weapon) - 1);
                openMenu(player);
                return;
            }
            if (slot == base + 2) {
                settings.setIntervalSeconds(player.getUniqueId(), weapon, settings.getIntervalSeconds(player.getUniqueId(), weapon) + 1);
                openMenu(player);
                return;
            }
            if (slot == base + 3) {
                settings.setAnimationEnabled(player.getUniqueId(), weapon, !settings.isAnimationEnabled(player.getUniqueId(), weapon));
                openMenu(player);
                return;
            }
        }
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onEntityHit(EntityDamageByEntityEvent event) {
        Entity damager = event.getDamager();
        if (!(damager instanceof Player player) || getHeldWeapon(player) == null) {
            return;
        }
        playSound("ENTITY_PLAYER_ATTACK_SWEEP", player);
    }

    private void openMenu(Player player) {
        Inventory inventory = Bukkit.createInventory(null, 54, MENU_TITLE);
        TacticalWeapon active = settings.getActiveWeapon(player.getUniqueId());
        int[] selectionSlots = {10, 13, 16};
        TacticalWeapon[] weapons = TacticalWeapon.values();
        for (int index = 0; index < weapons.length; index++) {
            TacticalWeapon weapon = weapons[index];
            String status = weapon == active ? "&aSelected" : "&7Click to equip";
            inventory.setItem(selectionSlots[index], createDisplayItem(weapon.material(), "&8" + weapon.displayName(), List.of(status, "&7Server-side item representation")));

            int slot = weapon.settingsSlot();
            int interval = settings.getIntervalSeconds(player.getUniqueId(), weapon);
            boolean enabled = settings.isAnimationEnabled(player.getUniqueId(), weapon);
            inventory.setItem(slot, createDisplayItem("ARROW", "&eInterval -1s", List.of("&7Click to decrease")));
            inventory.setItem(slot + 1, createDisplayItem("CLOCK", "&b" + weapon.displayName() + " interval: " + interval + "s", List.of("&7Range: 1-10 seconds")));
            inventory.setItem(slot + 2, createDisplayItem("ARROW", "&eInterval +1s", List.of("&7Click to increase")));
            inventory.setItem(slot + 3, createDisplayItem(enabled ? "LIME_DYE" : "GRAY_DYE", "&fIdle cue: " + (enabled ? "&aON" : "&cOFF"), List.of("&7Click to toggle for " + weapon.displayName())));
        }
        player.openInventory(inventory);
    }

    private TacticalWeapon weaponForSelectionSlot(int slot) {
        return switch (slot) {
            case 10 -> TacticalWeapon.VANILLA;
            case 13 -> TacticalWeapon.KARAMBIT;
            case 16 -> TacticalWeapon.BUTTERFLY;
            default -> null;
        };
    }

    private ItemStack createWeaponItem(TacticalWeapon weapon) {
        ItemStack item = createDisplayItem(weapon.material(), "&8" + weapon.displayName(), List.of("&7Tactical weapon", "&7Selected in the /knives menu"));
        if (item == null) {
            return null;
        }
        ItemMeta meta = item.getItemMeta();
        if (meta != null) {
            meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, weapon.name());
            item.setItemMeta(meta);
        }
        return item;
    }

    private ItemStack createDisplayItem(String materialName, String displayName, List<String> lore) {
        ItemStack item = XMaterial.matchXMaterial(materialName).map(XMaterial::parseItem).orElse(null);
        if (item == null) {
            return null;
        }
        ItemMeta meta = item.getItemMeta();
        if (meta == null) {
            return item;
        }
        meta.setDisplayName(color(displayName));
        meta.setLore(lore.stream().map(this::color).toList());
        item.setItemMeta(meta);
        return item;
    }

    private TacticalWeapon getHeldWeapon(Player player) {
        ItemStack item = player.getInventory().getItemInMainHand();
        if (!item.hasItemMeta()) {
            return null;
        }
        String value = item.getItemMeta().getPersistentDataContainer().get(weaponKey, PersistentDataType.STRING);
        if (value == null) {
            return null;
        }
        try {
            return TacticalWeapon.valueOf(value);
        } catch (IllegalArgumentException exception) {
            return null;
        }
    }

    private void runIdleCues() {
        long now = System.currentTimeMillis();
        for (Player player : Bukkit.getOnlinePlayers()) {
            TacticalWeapon weapon = getHeldWeapon(player);
            UUID playerId = player.getUniqueId();
            if (weapon == null || !settings.isAnimationEnabled(playerId, weapon)) {
                nextIdleCue.remove(playerId);
                continue;
            }
            long next = nextIdleCue.getOrDefault(playerId, now + settings.getIntervalSeconds(playerId, weapon) * 1000L);
            if (now >= next) {
                playSound("ITEM_TRIDENT_RIPTIDE_1", player);
                nextIdleCue.put(playerId, now + settings.getIntervalSeconds(playerId, weapon) * 1000L);