π
pasted-code-1772173327272.txt
txt
216 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 support)
- No duplication exploits
- No item glitches
- No cooldown bypass
- Fully optimized and lag-free
- Must compile without errors
====================================================
CORE CONCEPT
====================================================
infstone is a PvP progression plugin with collectible ability stones.
Players collect stones, steal them from others in PvP, and unlock powerful abilities.
IMPORTANT:
- Stone abilities must work on BOTH players and mobs.
- All combat logic must support PvP and PvE.
- Stones must NEVER drop on ground under ANY condition.
====================================================
STONE SYSTEM
====================================================
Total Stones:
- 12 Common Stones
- 6 Rare Stones
- Total = 18
On first join:
- Player receives 3 random stones
- 2 Common
- 1 Rare
- Saved permanently
All stones:
- Bound to player
- Cannot be dropped
- Cannot be stored in chests
- Cannot be traded
- Cannot be thrown
- Cannot be placed in containers
- Must use PersistentDataContainer for storage
====================================================
DEATH TRANSFER SYSTEM (FIXED)
====================================================
If player is killed by another player:
Death #1:
- Transfer 1 Common stone directly to killer
- NOT dropped on ground
Death #2:
- Transfer another Common stone
Death #3:
- Transfer 1 Rare stone
After 3rd death:
- Cycle resets
If player dies from:
- Fall damage
- Lava
- Void
- Mob
- Drowning
- Explosion
- Any natural cause
THEN:
- NO stone transfer
- NO stone drop
- NO stone loss after respawn
Stones must NEVER appear as physical dropped items.
====================================================
COMMON STONES
====================================================
- 12 total
- Each has 1 ability
- Activated ONLY by RIGHT CLICK
- Cooldown: 8β25 seconds
- Slightly improved powers
- Balanced for PvP and PvE
- Custom particles
- No permanent fly
- No wall glitches
====================================================
RARE STONES
====================================================
- 6 total
- Each has 3 abilities:
β’ Right Click
β’ Left Click
β’ Shift + Right Click
Cooldowns:
- Reduced compared to original design
- Approximately 250β425 seconds total range
- Since 3 abilities exist, cooldown per ability must be smaller and balanced
Rules:
- No infinite flying
- No world-breaking exploits
- Must affect mobs and players
- Strong but not server crashing
- Enhanced particles
====================================================
COOLDOWN DISPLAY
====================================================
Show cooldowns in ActionBar.
Compact format example:
π₯:12s | π»:5s | β‘:2m
Requirements:
- Automatically scale based on number of stones
- Short compact time formatting
- Efficient updating (no lag)
====================================================
STONE GENERATOR RECIPE
====================================================
Top row: 3 Diamond Blocks
Middle: Enchanted Golden Apple | Netherite Ingot | Enchanted Golden Apple
Bottom row: 3 Diamond Blocks
Result:
- Random stone
- Rare stones keep rare probability
- GODBLADE must NOT be obtainable here
====================================================
GODBLADE (RENAMED)
====================================================
Crafting:
- Any 9 stones β GODBLADE
Stats:
- Diamond Sword
- Sharpness III
- Unbreakable
- Bound item
Abilities:
1. Right Click β Lightning Storm (affects players & mobs)
2. Left Click β Explosive Slash (controlled explosions)
3. Shift + Right Click β Temporary Flight Mode
Passive while holding:
- Jump Boost
- Strength I
- Speed I
- Glowing
- Resistance I
- Custom particles
Balanced but extremely powerful.
====================================================
ADMIN COMMANDS
====================================================
/infstone give
/infstone remove
/infstone list
/infstone reload
/infstone reset
/infstone deaths
====================================================
TECHNICAL STRUCTURE
====================================================
Must include:
- Main class
- AbilityManager
- CooldownManager
- StoneManager
- DeathTransferManager
- CraftingManager
- ParticleUtility
- CommandHandler
- ConfigManager
Data:
- Use PersistentDataContainer
- Save player stones properly
- No data loss
Provide:
- Full project structure
- plugin.yml
- config.yml
- All classes separated
- Fully commented
- Production-ready code
Iβll analyze the requirements and plan the implementation carefully.
Physical stone items with PDC tagging (item + player PDC backup), 18 stones total, protected from all non-combat transfers
Death transfer system (3-cycle PvP), cooldown action bar, stone generator recipe, GodBlade crafting from 9 stones
All 18 stone abilities (12 common Γ 1, 6 rare Γ 3) + GodBlade abilities, targeting both players and mobs
Now let me fix several issues I caught in review β XMaterial missing import in AbilityManager, incorrect GodBlade stone-removal logic in CraftingManager, XPotion name accuracy, and the inventory click protection allowing crafting tables for GodBlade crafting:
The implementation is complete. Let me provide a brief summary of the full system:
What was built β 16 production-ready files:
InfStone.javaβ Main class initialising all managers in correct dependency orderStoneType.javaβ Enum of all 18 stones (12 common, 6 rare) with abilities, cooldowns, emojis, materialsStoneManager.javaβ Dual-storage: PDC on player (source of truth) + physical items in inventory; auto-syncs on join to prevent data loss on crashesAbilityManager.javaβ Every single ability implemented: 12 common (right-click), 6 rare Γ 3 (RC/LC/SRC), plus GodBladeβs 3 abilities and passive. All target both players and mobs via raycast +getNearbyEntitiesCooldownManager.javaβ Memory-based cooldown tracking with compact action bar (π₯:12s | βοΈ:RDY | β‘:2m) updating every tick intervalDeathTransferManager.javaβ 3-cycle PvP death system: death 1βcommon, death 2βcommon, death 3βrare, then resets; ignores all natural deathsCraftingManager.javaβ Registered shaped Stone Generator recipe (Diamond Blocks + Enchanted Apple + Netherite);PrepareItemCraftEventdynamically shows a random stone or GodBlade result; 9-stone GodBlade detected without a registered recipePlayerListener.javaβ Prevents drops, swap, and container storage; allows crafting tables (for GodBlade); all stones stripped from death loot before anything hits the groundItemUtil.java/ParticleUtility.javaβ Stone item builder with full lore/PDC; ring, sphere, burst, pillar particle helpers using XParticleCommandHandler.javaβ Full/infstone give|remove|list|reload|reset|deathswith tab-completion
Key design decisions:
Stones are physical protected items + PDC backup β if an item is lost to a crash, it is restored on next login via
syncInventoryToDataStones never touch the ground β drops are filtered in
PlayerDeathEventbefore Bukkit scatters themGodBlade is uncraftable from the Stone Generator (generator only produces individual stones from its registered recipe); only 9-stone crafting table works
make it more costomizable in config.yml file
Let me read all the project files to understand the current structure.
Now let me read the actual implementation files to find all hardcoded values.
[Generation stopped]
π
pasted-code-1772196300338.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.
package com.infstone;
import com.infstone.command.CommandHandler;
import com.infstone.listener.PlayerListener;
import com.infstone.manager.AbilityManager;
import com.infstone.manager.ConfigManager;
import com.infstone.manager.CooldownManager;
import com.infstone.manager.CraftingManager;
import com.infstone.manager.DeathTransferManager;
import com.infstone.manager.StoneManager;
import com.infstone.util.Keys;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class InfStone extends JavaPlugin {
private ConfigManager configManager;
private StoneManager stoneManager;
private AbilityManager abilityManager;
private CooldownManager cooldownManager;
private DeathTransferManager deathTransferManager;
private CraftingManager craftingManager;
@Override
public void onEnable() {
saveDefaultConfig();
Keys.init(this);
this.configManager = new ConfigManager(this);
this.cooldownManager = new CooldownManager(this);
this.stoneManager = new StoneManager(this);
this.abilityManager = new AbilityManager(this);
this.deathTransferManager = new DeathTransferManager(this);
this.craftingManager = new CraftingManager(this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
CommandHandler commandHandler = new CommandHandler(this);
getCommand("infstone").setExecutor(commandHandler);
getCommand("infstone").setTabCompleter(commandHandler);
cooldownManager.startActionBarTask();
abilityManager.startGodBladePassiveTask();
}
@Override
public void onDisable() {
cooldownManager.cancelAll();
}
}