ankush977._80414
📎 1 file 5,915 chars
📄
pasted-code-1772194868320.txt
txt 258 lines
▶
Create a complete production-ready Minecraft Paper plugin for version 1.21.11. 

Plugin Name: infstone

Compatibility:
- Paper 1.21.11 
- Geyser compatible (Bedrock supported)
- No duplication exploits
- No item glitches
- No cooldown bypass
- Fully optimized
- Must compile without errors

====================================================
CORE CONCEPT
====================================================

infstone is a PvP + PvE progression plugin with collectible ability stones.

Abilities must work on:
- Players
- All mobs

Stones must NEVER drop physically under any condition.

====================================================
STONE SYSTEM
====================================================

Total:
- 12 Common Stones (1 ability each)
- 6 Rare Stones (3 abilities each)

On first join:
- 3 random stones
- 2 Common
- 1 Rare
- Saved permanently

All stones:
- Bound to player
- Cannot be dropped
- Cannot be placed in containers
- Cannot be thrown
- Stored using PersistentDataContainer

====================================================
DEATH TRANSFER SYSTEM
====================================================

If killed by another player:

Death 1 → 1 Common transfers to killer  
Death 2 → 1 Common transfers  
Death 3 → 1 Rare transfers  

Cycle resets after third death.

Natural death (fall, lava, mob, void, etc):
- NO transfer
- NO drop
- NO loss

Fix issue where stones currently drop on natural death.

====================================================
NEW: PLAYER STONE TRANSFER COMMANDS
====================================================

Players must be able to transfer stones voluntarily.

Add commands:

/infstone transfer  
- Transfers specific stone to target player

/infstone transferall 
- Transfers all stones to target player

Rules:
- Cannot transfer while in combat (configurable)
- Must confirm transfer with clickable chat confirmation
- Cannot duplicate
- Cooldown between transfers (configurable)

====================================================
COOLDOWN SYSTEM (FIX BROKEN COOLDOWNS)
====================================================

Fix issue where some stones cooldown does not work.

Requirements:
- Central CooldownManager
- Separate cooldown per:
   Player + Stone + Ability Type
- Prevent bypass via item switching
- Prevent relog bypass
- Prevent world change bypass
- Store cooldowns safely in memory

====================================================
COOLDOWN DISPLAY (IMPROVED UI)
====================================================

Make ActionBar look clean and modern.

Example format:

[🔥 12s] [👻 5s] [⚡ 2m]

Requirements:
- Clean spacing
- Colored formatting
- Auto-scale for many stones
- Smooth updating (every 10 ticks max)
- No spam lag

====================================================
COMMON STONES
====================================================

- 12 total
- 1 ability
- Right Click activation
- Cooldown: 8–25 seconds
- Balanced PvP + PvE
- Custom particles

====================================================
RARE STONES
====================================================

- 6 total
- 3 abilities each:
   • Right Click
   • Left Click
   • Shift + Right Click

Cooldown range:
- 120–300 seconds per ability (balanced smaller since 3 abilities exist)

Strong but optimized.
No infinite fly abuse.
No world breaking.

====================================================
NEW: STONE CRAFTING SYSTEM
====================================================

Players must be able to craft stones.

Common Stone Recipe:
- Easy recipe
- Returns RANDOM Common stone

Rare Stone Recipe:
- Harder recipe
- Returns RANDOM Rare stone

Both recipes must be:
- Fully configurable in config.yml
- Materials customizable
- Amounts customizable
- Enable/disable toggle in config

====================================================
GODBLADE
====================================================

Crafting:
- Any 9 stones → GODBLADE

Stats:
- Diamond Sword
- Sharpness III
- Unbreakable
- Bound item

Abilities:
1. Right Click → Lightning Storm
2. Left Click → Explosive Slash
3. Shift + Right Click → Flight Mode

Passive Effects:
- Jump Boost
- Strength I
- Speed I
- Glowing
- Resistance I

Cooldowns configurable.

====================================================
CONFIGURATION (HIGHLY CUSTOMIZABLE)
====================================================

config.yml must include:

- Enable/Disable each stone
- Cooldown per stone
- Damage values
- Effect duration
- PvP damage multiplier
- PvE damage multiplier
- Transfer system enable/disable
- Combat restriction toggle
- Cooldown display format
- Recipe materials (common & rare)
- Godblade recipe
- Particle toggle
- ActionBar toggle

All values fully editable.

====================================================
ADMIN COMMANDS
====================================================

/infstone give  
/infstone remove  
/infstone list
/infstone reload
/infstone reset 
/infstone deaths 
/infstone transfer  
/infstone transferall 

Add permissions for each command.

====================================================
TECHNICAL STRUCTURE
====================================================

Must include:

- Main class
- StoneManager
- AbilityManager
- CooldownManager (centralized)
- TransferManager
- DeathTransferManager
- CraftingManager
- CombatTagManager
- ParticleUtility
- CommandHandler
- ConfigManager

Provide:
- Full project folder structure
- plugin.yml
- config.yml
- All classes separated
- Fully commented
- Production-ready code
- No missing imports
- No errors

Generate complete working plugin.
Kodari AI
KodariFeb 27 at 12:37 pm 67,539 (v2)
InfStone
A PvP + PvE progression plugin featuring 18 collectible ability stones (12 Common, 6 Rare) bound to players. Includes a death-based stone transfer system, voluntary player transfers with confirmation, centralized anti-bypass cooldowns displayed on a clean action bar, stone crafting recipes, a craftable GodBlade with passive effects, full admin commands, and Geyser/Bedrock compatibility. All stones are PDC-bound and can never be physically dropped.

I’ll build this complete plugin systematically across ~23 files. Here’s my plan:

  • Start with data types (StoneType, AbilityType, StoneRarity enums), then utilities

  • Build managers bottom-up: Cooldown → Combat → Stone → Death → Transfer → Crafting → Godblade → Ability → ActionBar

  • Then listeners, command, and main class

  • Config and plugin.yml last

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
24 2,957
src/main/java/com/infstone/InfStone.java
package com.infstone;

import com.infstone.command.InfStoneCommand;
import com.infstone.config.ConfigManager;
import com.infstone.listener.CraftingListener;
import com.infstone.listener.DeathListener;
import com.infstone.listener.ProtectionListener;
import com.infstone.listener.StoneListener;
import com.infstone.manager.*;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class InfStone extends JavaPlugin {

    @Getter private static InfStone instance;

    @Getter private ConfigManager cfg;
    @Getter private StoneManager stoneManager;
    @Getter private CooldownManager cooldownManager;
    @Getter private CombatTagManager combatTagManager;
    @Getter private AbilityManager abilityManager;
    @Getter private DeathTransferManager deathTransferManager;
    @Getter private TransferManager transferManager;
    @Getter private CraftingManager craftingManager;
    @Getter private GodbladeManager godbladeManager;
    @Getter private ActionBarManager actionBarManager;

    @Override
    public void onEnable() {
        instance = this;

        cfg = new ConfigManager(this);
        cooldownManager = new CooldownManager(this);
        combatTagManager = new CombatTagManager(this);
        stoneManager = new StoneManager(this);
        deathTransferManager = new DeathTransferManager(this);
        transferManager = new TransferManager(this);
        craftingManager = new CraftingManager(this);
        godbladeManager = new GodbladeManager(this);
        abilityManager = new AbilityManager(this);
        actionBarManager = new ActionBarManager(this);

        craftingManager.registerRecipes();
        godbladeManager.startPassiveTask();
        actionBarManager.startTask();

        getServer().getPluginManager().registerEvents(new StoneListener(this), this);
        getServer().getPluginManager().registerEvents(new DeathListener(this), this);
        getServer().getPluginManager().registerEvents(new ProtectionListener(this), this);
        getServer().getPluginManager().registerEvents(new CraftingListener(this), this);

        InfStoneCommand cmd = new InfStoneCommand(this);
        getCommand("infstone").setExecutor(cmd);
        getCommand("infstone").setTabCompleter(cmd);

        getLogger().info("InfStone enabled successfully.");
    }

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