yourdevilpro
📎 1 file 7,923 chars
📄
pasted-code-1785866277815.txt
txt 142 lines
▶
Act as a Principal Minecraft Java Plugin Architect & Lead Systems Engineer (Spigot/Paper 1.21.x API).
Build a comprehensive, production-ready, highly modular, and fully customizable Minecraft plugin named "ItemMaker".

==================================================
PLUGIN METADATA & BRANDING CREDITS
==================================================
- Plugin Name: ItemMaker
- Authors: @yourdevilpro, @affan95
- Studio Credit: Vex Studio
- Base Command: /itemmaker menu
- Permissions: 
  - itemmaker.admin (Full INVENTORY GUI and management access)
  - itemmaker.recipes (Permission required to craft custom recipes on standard Crafting Tables)

==================================================
MAIN INVENTORY GUI NAVIGATION & LAYOUT
==================================================
Executing "/itemmaker menu" opens a Main Hub INVENTORY GUI (27-slot or 54-slot container) featuring 5 distinct primary category modules:

--------------------------------------------------
CATEGORY 1: ITEM CREATION ENGINE & STUDIO (19 DETAILED MODULES)
--------------------------------------------------
Clicking Category 1 opens the Global Material Selector:
- A paginated, multi-page INVENTORY GUI containing every Bukkit Material (all vanilla Minecraft items).
- An interactive Search Engine (Anvil INVENTORY GUI or Chat Input) to instantly filter items by name/type.
- Selecting any item opens the 19-Module Customization Studio:

1. Dynamic Item Rename Engine:
   - Interactive Anvil/Chat input allowing item display name changes.
   - Full support for Hex RGB colors (e.g., &#FF5522) and Legacy formatting codes (§ / &).

2. Multi-Line Lore Editor:
   - Dynamic line-by-line Lore Manager (Add, Edit, Remove, Reorder lines).
   - Supports placeable variables and color codes.

3. Unbreakable & Expiration Engine:
   - Toggle vanilla Unbreakable flag.
   - Set a real-world expiration timer (e.g., item expires and disappears in 7 days / 2 hours).

4. Cooldown System:
   - Per-item usage cooldown in ticks or seconds.
   - Visual actionbar progress bar and sound feedback when on cooldown.

5. Enchantment Glow Manager:
   - Toggle enchantment sheen without displaying vanilla enchantment tooltips or flags.

6. Vanilla Enchantment Applicator:
   - Selector INVENTORY GUI displaying all vanilla enchantments.
   - Set custom enchantment levels (including unsafe levels like Sharpness 10).

7. Self-Particle Aura System:
   - Attach continuous ambient particle effects or active particles to the holder/user.

8. Target Hit Particle Engine:
   - Spawns specific visual particles directly on the victim when attacked by this item.

9. Dynamic Multi-Command & Unlimited Keybind Engine:
   - Click "Create New Command" -> Prompt chat: "Write your cmd without /".
   - Generates a dedicated command item inside the INVENTORY GUI.
   - Click the command item to set its specific execution trigger:
     - Default: Right-Click
     - Modifiable to: Left-Click, Shift+Right, Shift+Left, or custom keyboard keys.
   - Per-Command Customization:
     - Each command on the same item can have its OWN distinct Particles, Sounds, and Keybinds (e.g., Right-Click = /gamemode creative with Flame particles & Level-Up sound; Left-Click = /fly with End Rod particles & Anvil sound).
     - Unlimited commands can be added to a single item.
   - Includes a full Command Manager List INVENTORY GUI to edit, delete, or re-bind any command.

10. Target Potion Effect Applicator:
    - Apply custom status/potion effects (Poison, Wither, Slowness, etc.) to the hit target.
    - Customizable trigger keys, duration, and amplifier levels.

11. EXTREMELY DETAILED USAGE COST & ECONOMY ENGINE:
    - Dedicated Cost Configuration INVENTORY GUI with multiple deduction modes:
      a) Vault Economy Integration: Deduct player balance per click/usage (e.g., $100 per use).
      b) Custom Console Cost Command: Execute custom backend cost commands (e.g., `eco take %player% 100` or `token take %player% 5`). Owner can freely type ANY custom cost command.
      c) Dynamic Balance Check: Verifies player balance BEFORE item usage/command execution. If player balance is insufficient, usage is blocked and a custom error message is sent.
      d) Multi-Currency / Custom Plugin Support: Flexible enough to execute any currency command for custom economy plugins.

12. Custom Recipe Creator Studio:
    - Opens an interactive 3x3 Crafting Grid INVENTORY GUI with a side-panel Creative Material Palette.
    - Drag-and-drop item placement to design custom crafting recipes.
    - Permission Locked: Recipes can only be crafted on vanilla Crafting Tables by players holding `itemmaker.recipes` or Operator status.

13. Limited Uses & Shatter System:
    - Set maximum total usage charges.
    - Automatically shatters/destroys the item when remaining charges hit 0.

14. Custom Combat & Death Logs:
    - Fully customizable kill and death messages with `%killer%` and `%victim%` placeholders.

15. Dynamic Help & Lore Keybind Integrator:
    - Automatically injects default lore line: "For usage help click H".
    - Opens a Help Keybind Config INVENTORY GUI where owner can rebind the help key and format the help guide displaying all assigned features/keybinds.

16. World Event Trigger Engine:
    - Triggers Minecraft world events (e.g., Raids, Lightning Storms, Weather Changes) upon usage.

17. XP Level & Point Cost Engine:
    - Toggleable option to charge XP levels or raw XP points per item usage or per crafting action.

18. Enchantment Whitelist & Blacklist Matrix:
    - Define forbidden enchantments per item (e.g., Block Sharpness 5).
    - Prevents blacklisted enchantments from being added via Anvil, Enchanting Table, or Combining Books.
    - INVENTORY GUI to add/remove blocked enchantments dynamically.

19. Custom Keybind Event Instance Creator:
    - Create dynamic event instances (e.g., Press Keybind -> Prompt chat for target player username -> Execute action like /tp ).

--------------------------------------------------
CATEGORY 2: SAVED ITEM VAULT
--------------------------------------------------
- Grid INVENTORY GUI listing all saved custom items stored in `items.yml`.
- One-click Claim, Duplicate, Edit, and Delete features.

--------------------------------------------------
CATEGORY 3: CUSTOM ENCHANTING & BOOK ENGINE
--------------------------------------------------
1. Custom Enchantment / Book Creator.
2. Custom Display Name and Lore.
3. Command & Keybind Triggers (reusing Category 1 logic).
4. Success Rate Percentage (0% to 100%).
5. Failure Penalty System:
   - Toggle: Destroy target item on fail OR destroy only the Enchanted Book on fail.
   - Custom particles, sounds, and potion effects attached to custom books upon application.

--------------------------------------------------
CATEGORY 4: ITEM ANALYTICS & DISTRIBUTION HUB
--------------------------------------------------
- Inventory Inspector: Give, Take, or View custom items across all players.
- Metadata Analytics: Displays Creation Date/Time, Creator UUID, and circulating item count.

--------------------------------------------------
CATEGORY 5: SYSTEM AUDIT LOG ENGINE
--------------------------------------------------
- File Logger (`logs/itemmaker.log`) tracking creation, deletion, recipe crafting, and command usage with precise timestamps.

==================================================
TECHNICAL CONSTRAINTS & CODE PATTERNS
==================================================
1. Store all item data losslessly inside Paper `PersistentDataContainer` (PDC API).
2. Clean modular Java architecture across packages (`INVENTORY GUI`, `listeners`, `managers`, `models`, `commands`).
3. Include full `plugin.yml` with permissions and credit to Vex Studio (@yourdevilpro, @affan95).
Kodari AI
KodariAug 4 at 6:01 pm 16
ItemMaker
A comprehensive Minecraft plugin providing a modular item creation studio with 19 customization modules including dynamic renaming, multi-line lore, enchantments, particle effects, command keybinds, cooldowns, and economy integration. Features a paginated material selector, saved item vault, custom enchanting book engine, analytics hub, and audit logging. Uses PersistentDataContainer for lossless item data storage and includes a full inventory GUI framework with search functionality. Supports Vault economy, custom cost commands, recipe crafting with permission locks, limited uses with shatter system, and world event triggers. Includes comprehensive permission system and credit to Vex Studio.
  1. Establish the Paper 1.21 project, metadata, permissions, persistence, and audit logging.

  2. Build the reusable inventory GUI, material search/selector, item studio, vault, and category hubs.

  3. Implement PDC-backed item profiles, command bindings, recipes, runtime effects/costs/charges, and recipe permission enforcement.

Built the ItemMaker Paper 1.21 project from scratch.

  • Added Gradle project setup, plugin.yml, configuration, permissions, and Vex Studio credits.

  • Implemented /itemmaker menu with the five-category admin hub.

  • Added searchable, paginated material selection and a PDC-backed 19-module item customization studio.

  • Added saved-item vault persistence in items.yml, item claiming/editing/deletion flow, custom recipes, audit logging, command bindings, costs, cooldowns, charges, expiry, particles, and runtime effects.

  • Added recipe permission enforcement through itemmaker.recipes and Vault economy support when Vault is installed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
26 1,243
src/main/java/com/vexstudio/itemmaker/ItemMakerPlugin.java
package com.vexstudio.itemmaker;

import com.vexstudio.itemmaker.command.ItemMakerCommand;
import com.vexstudio.itemmaker.gui.GuiManager;
import com.vexstudio.itemmaker.listener.GuiListener;
import com.vexstudio.itemmaker.listener.ItemRuntimeListener;
import com.vexstudio.itemmaker.listener.RecipeListener;
import com.vexstudio.itemmaker.manager.AuditLog;
import com.vexstudio.itemmaker.manager.ChatPromptManager;
import com.vexstudio.itemmaker.manager.ItemFactory;
import com.vexstudio.itemmaker.manager.ItemRepository;
import lombok.Getter;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ItemMakerPlugin extends JavaPlugin {
    private GuiManager guiManager;
    private ChatPromptManager chatPromptManager;
    private ItemFactory itemFactory;
    private ItemRepository itemRepository;
    private AuditLog auditLog;

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

        this.guiManager = new GuiManager();
        this.chatPromptManager = new ChatPromptManager(this);
        this.itemFactory = new ItemFactory(this);
        this.itemRepository = new ItemRepository(this);
        this.auditLog = new AuditLog(this);

        this.itemRepository.registerStoredRecipes();
        getServer().getPluginManager().registerEvents(new GuiListener(guiManager), this);
        getServer().getPluginManager().registerEvents(chatPromptManager, this);
        getServer().getPluginManager().registerEvents(new ItemRuntimeListener(this), this);
        getServer().getPluginManager().registerEvents(new RecipeListener(this), this);

        PluginCommand command = getCommand("itemmaker");
        if (command != null) {
            ItemMakerCommand executor = new ItemMakerCommand(this);
            command.setExecutor(executor);
            command.setTabCompleter(executor);
        }
    }

    @Override
    public void onDisable() {
        if (auditLog != null) {
            auditLog.close();
        }
    }
}