blazeofpower
📎 1 file 2,227 chars
📄
pasted-code-1782516173058.txt
txt 60 lines
▶
Create a Minecraft Paper 1.21.1 plugin called CustomWeapons.

Weapon 1: Picace
Create a custom Netherite Pickaxe called §bPicace.
It should function as a normal pickaxe for mining.
When used to attack an entity:
Perform the vanilla Mace Smash attack.
Damage increases based on the player's falling distance.
Use the vanilla Mace sounds, particles, and mechanics.
Prevent fall damage if the smash attack is successful.
Weapon 2: Lucky Strength Sword
Create a custom Diamond Sword called §bLucky Strength Sword.
Every successful hit on a player or mob:
Give either:
Strength III (50% chance) or
Strength IV (50% chance).
Effect lasts 5 seconds.
Refresh the timer on every hit.
Play particles and a sound when the effect activates.
Finding the Weapons

The custom weapons should not be obtainable through crafting.

Instead:

Generate Pedestal Stones naturally around the world.
A Pedestal Stone is a custom structure made from stone blocks with the weapon displayed on top.
Each Pedestal Stone has a random chance to contain either:
Picace, or
Lucky Strength Sword.
The structures should spawn rarely across the Overworld, making the weapons feel like legendary loot.
Players can simply right-click or break the display to claim the weapon.
Once claimed, the Pedestal Stone becomes empty and cannot generate another weapon.
The spawn rate should be configurable in config.yml.
Commands
/customweapons give picace
/customweapons give luckysword
/customweapons reload
Configuration

Create a config.yml with options for:

Enable/disable each weapon.
Weapon spawn rate.
Maximum number of Pedestal Stones per world.
Strength effect duration.
Chance for Strength III and Strength IV.
Picace damage multiplier.
Weapon names and lore.
Requirements
Compatible with Paper 1.21.1.
Written in clean, well-commented Java.
Production-ready and free of compile errors.
Register commands, listeners, permissions, plugin.yml, and config.yml.
No resource pack required.
Weapons keep their abilities after restarts.
Only the custom versions have special abilities.
Optimized for multiplayer servers.

This should create a polished RPG-style plugin where players must explore the world to discover rare Pedestal Stones containing legendary weapons.
Kodari AI
KodariJun 26 at 11:26 pm 1
CustomWeapons
A Paper 1.21.1 RPG plugin featuring two legendary weapons hidden across the Overworld inside generated Pedestal Stones. The Picace is a netherite pickaxe that performs mace-style smash attacks from fall distance. The Lucky Strength Sword grants random Strength III or IV on each hit. Weapons are found by exploring the world, not crafted. Features configurable spawn rates, weapon stats, admin give commands, and persistent data across restarts.

I’ll build the full plugin from scratch. Here’s the plan:

Structure:

  • build.gradle, plugin.yml, config.yml

  • com.customweapons.CustomWeapons — main class

  • com.customweapons.commands.CustomWeaponsCommand — give/reload

  • com.customweapons.util.ColorUtil — MiniMessage

  • com.customweapons.weapons.WeaponManager — creates/tags weapons via PDC

  • com.customweapons.weapons.PicaceListener — smash attack on fall

  • com.customweapons.weapons.LuckySwordListener — strength on hit

  • com.customweapons.pedestal.PedestalManager — chunk gen + claiming

Data flow: PedestalManager listens for new chunks → deterministic random decides spawn → builds stone shrine with item frame holding weapon → PlayerInteractEntityEvent / damage event handles claiming → claimed locations persisted to file.

Starting with build infrastructure, then plugin core, then weapons, then pedestals.

All 11 files created. Here’s a summary of what was built:

Structure (11 files):

File
Purpose
build.gradle
Paper 1.21.1, Java 21
plugin.yml
Command + permission registration
config.yml
All weapon stats, pedestal rates, block types
CustomWeapons.java
Plugin entry — registers listeners, commands
util/ColorUtil.java
MiniMessage deserializer
weapons/WeaponManager.java
Creates items with PDC tags, identifies weapons
weapons/PicaceListener.java
Detects fall attacks, adds distance-based bonus damage, spawns particles/sound, cancels fall damage
weapons/LuckySwordListener.java
On hit, rolls Strength III (50%) or IV (50%), refreshes duration, plays witch particles
pedestal/PedestalManager.java
Chunk generation, structure building, claiming via interact/damage, persistence
commands/CustomWeaponsCommand.java
/customweapons give <picace|luckysword> [player]
,
/customweapons reload
, tab completion

Key mechanics:

  • PDC tagging — weapons survive restarts; only tagged items have abilities

  • Deterministic Random — per-chunk seed (world seed + coords) ensures pedestal placement is consistent across restarts

  • New chunks only — pedestals generate in unexplored terrain so players must explore

  • Claimed tracking — claimed_pedestals.txt file prevents duplicate claims

  • Picace smash — bonus damage = fall distance × config multiplier, mace sound/SWEEP_ATTACK+POOF particles, fall distance reset

  • Lucky Sword — Strength III (amplifier 2) or IV (amplifier 3), witch particles + level-up sound

To build: ./gradlew build — the jar appears in build/libs/.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 673
src/main/java/com/customweapons/CustomWeapons.java
package com.customweapons;

import com.customweapons.commands.CustomWeaponsCommand;
import com.customweapons.pedestal.PedestalManager;
import com.customweapons.weapons.LuckySwordListener;
import com.customweapons.weapons.PicaceListener;
import com.customweapons.weapons.WeaponManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class CustomWeapons extends JavaPlugin {

    private WeaponManager weaponManager;
    private PedestalManager pedestalManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.weaponManager = new WeaponManager(this);
        this.pedestalManager = new PedestalManager(this, weaponManager);

        Bukkit.getPluginManager().registerEvents(new PicaceListener(this, weaponManager), this);
        Bukkit.getPluginManager().registerEvents(new LuckySwordListener(this, weaponManager), this);
        Bukkit.getPluginManager().registerEvents(pedestalManager, this);

        CustomWeaponsCommand command = new CustomWeaponsCommand(this, weaponManager);
        Bukkit.getPluginCommand("customweapons").setExecutor(command);
        Bukkit.getPluginCommand("customweapons").setTabCompleter(command);

        getLogger().info("CustomWeapons enabled — seekers of legend, sharpen your blades.");
    }

    @Override
    public void onDisable() {
        getLogger().info("CustomWeapons disabled.");
    }

    public WeaponManager getWeaponManager() {
        return weaponManager;
    }

    public PedestalManager getPedestalManager() {
        return pedestalManager;
    }
}