erragar

Develop a weaponry plugin that allows players to equip donkeys, horses, pigs, and llamas with weapons in a new dedicated slot. Implement three tiers of weaponry: Tier 1 for Arrows, Tier 2 for Fire Charges, and Tier 3 for launching lit TNT forward, each with unique textures. Ensure that the plugin supports configurable weapon stats, cooldowns, and permissions for different player roles.

Kodari AI
KodariApr 18 at 3:49 pm 14,717 (v2)

I’ll create a mount weaponry plugin that allows players to equip weapons on rideable animals with three tiers of projectile attacks.

MountWeaponry
A unique combat plugin that adds equippable weapon systems to mounts including horses, donkeys, pigs, and llamas. Features three weapon tiers: Tier 1 fires arrows, Tier 2 launches fire charges, and Tier 3 shoots primed TNT. Each tier has custom textures via custom model data and configurable stats including damage, cooldown, velocity, and ammunition costs. Includes permission-based access control, per-player cooldown tracking, and an intuitive GUI for weapon management.

All files created successfully!

MountWeaponry is now ready with:

  • Three weapon tiers (Arrows, Fire Charges, TNT) with custom model data support for textures

  • Equip weapons to mounts using /mw equip or the GUI system

  • Right-click while riding to fire weapons with configurable cooldowns

  • Ammunition costs and permission-based tier access

  • Persistent weapon storage on entities using PersistentDataContainer

  • Complete admin commands: /mw give, /mw list, /mw reload

  • Sound effects and particle effects for weapon usage

  • Supports horses, donkeys, mules, pigs, and llamas

Configure weapon stats (damage, cooldown, velocity, explosion power) in config.yml. Players need a resource pack with custom model data 1001-1003 for weapon textures.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 1,154
src/main/java/com/mountweaponry/MountWeaponry.java
package com.mountweaponry;

import com.mountweaponry.commands.WeaponCommand;
import com.mountweaponry.gui.WeaponSelectionGUI;
import com.mountweaponry.listeners.EntityListener;
import com.mountweaponry.listeners.MountListener;
import com.mountweaponry.listeners.WeaponUseListener;
import com.mountweaponry.managers.ConfigManager;
import com.mountweaponry.managers.CooldownManager;
import com.mountweaponry.managers.MountManager;
import com.mountweaponry.managers.WeaponManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class MountWeaponry extends JavaPlugin {
    private ConfigManager configManager;
    private WeaponManager weaponManager;
    private MountManager mountManager;
    private CooldownManager cooldownManager;
    private WeaponSelectionGUI weaponGUI;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.weaponManager = new WeaponManager(this);
        this.mountManager = new MountManager(this);
        this.cooldownManager = new CooldownManager();
        this.weaponGUI = new WeaponSelectionGUI(this);
        
        getServer().getPluginManager().registerEvents(new WeaponUseListener(this), this);
        getServer().getPluginManager().registerEvents(new MountListener(this), this);
        getServer().getPluginManager().registerEvents(new EntityListener(this), this);
        getServer().getPluginManager().registerEvents(weaponGUI, this);
        
        WeaponCommand weaponCommand = new WeaponCommand(this);
        getCommand("mountweapon").setExecutor(weaponCommand);
        getCommand("mountweapon").setTabCompleter(weaponCommand);
        
        getLogger().info("MountWeaponry has been enabled!");
        getLogger().info("Version: " + getDescription().getVersion());
    }
    
    @Override
    public void onDisable() {
        if (cooldownManager != null) {
            cooldownManager.clearAll();
        }
        
        getLogger().info("MountWeaponry has been disabled!");
    }
}