kingofhell002
📎 1 file 5,050 chars
📄
pasted-code-1775664886348.txt
txt 306 lines
▶
Create a complete, production-ready Minecraft SMP plugin using Java (Spigot/Paper API).

PLUGIN NAME: TotemSMP

==================================================

🎯 CORE CONCEPT:

This plugin introduces a unique RPG-style system where each player is assigned ONLY ONE magical totem that grants powerful abilities.

Each totem has:

* 3 Active Abilities
* 2 Passive Abilities

The 3rd ability MUST be the strongest (Ultimate Ability).

==================================================

🔥 CRITICAL CUSTOM RULES:

1. Totem MUST NOT behave like a normal Totem of Undying:

   * It should NOT activate on death
   * It should NOT “pop” or save the player

2. Death Behavior:

   * Totem MUST remain in inventory after death
   * Must NEVER drop
   * Must NEVER disappear
   * Must NOT duplicate

3. Soul Binding:

   * Totem is bound to player UUID
   * Cannot be transferred
   * If another player gets it → disable OR return to owner

==================================================

🧿 TOTEM ITEM:

* Base item: Totem of Undying
* Use CustomModelData
* Use PersistentDataContainer
* Disable vanilla behavior

==================================================

🌟 TOTEM TYPES (9):

Ender, Wind, Light, Fire, Strength, Water, Nature, Ice, Shadow

==================================================

⚔️ ABILITY SYSTEM:

1 → Right Click
2 → Shift + Right Click
3 → /ability third (Ultimate)

Rules:

* Ability 3 strongest
* Unique abilities only
* No simple potion-only mechanics

Use:

* Velocity
* AoE effects
* Custom damage
* Particles & sounds
* Teleport / gravity / time effects

==================================================

🛡️ PASSIVE SYSTEM:

* Works ONLY when held (main/offhand)
* Remove instantly if not held
* No stacking
* Reapply safely

==================================================

🎬 SMP START SYSTEM:

/totem start

Flow:

1. Lock players

2. Countdown (5–1)

3. UNIQUE rolling animation:

   * Fast → slow
   * Fake-outs
   * 4–6 sec cinematic

4. Assign random totem

5. Effects + sounds

6. Announcement

7. Unlock players

Rules:

* Run once only
* Force mode available

==================================================

📜 COMMANDS:

PLAYER:

/totem menu
/totem info
/totem ability
/totem cooldown

ABILITY:
/ability third

==================================================

🛠️ ADMIN COMMANDS:

/totem give  
/totem set  
/totem remove 
/totem reroll 
/totem reload
/totem list
/totem resetall

==================================================

🎲 TARGETED REROLL SYSTEM:

Command:
/totem reroll 

Function:

* Removes current totem
* Assigns new random totem
* Updates data
* Replaces item instantly

RULES:

* Only affects selected player
* Respects blacklist
* Optional: avoid same totem

CONFIG OPTIONS:

reroll:
allow_same_totem: false
broadcast: true
require_confirmation: true

CONFIRMATION:

/totem reroll 
→ Ask confirmation

/totem reroll confirm
→ Execute

BROADCAST:

" has been granted a new destiny!"

PERMISSION:

totem.reroll

==================================================

🔒 ITEM RESTRICTIONS:

❌ Cannot drop
❌ Cannot store
❌ Cannot move
❌ Cannot swap

Cancel events:

* Drop
* Click
* Drag

==================================================

💀 DEATH SYSTEM:

PlayerDeathEvent:
→ Remove from drops

PlayerRespawnEvent:
→ Restore safely

✔ No duplication
✔ No loss

==================================================

📖 LORE:

Include:

* Name
* Theme
* 3 abilities (with usage)
* Passives

==================================================

🧰 INVENTORY GUI:

* 3x3 menu
* Show all totems
* Highlight player's

==================================================

⏳ COOLDOWN:

* Per player tracking
* No bypass
* Action bar display

==================================================

💾 DATA:

* UUID-based
* data.yml

==================================================

⚙️ CONFIG:

* Cooldowns
* Enable/disable totems
* Blacklist
* Messages
* Debug mode

==================================================

🧠 TECH:

Classes:

Main
TotemManager
AbilityManager
CooldownManager
CommandHandler
GUIManager

Use:

* Enums
* PersistentDataContainer
* Events (Interact, Death, Inventory, Respawn, Join)

==================================================

🔥 BUG-FREE REQUIREMENTS:

✔ All abilities MUST work
✔ Detect right-click AIR + BLOCK
✔ Correct shift detection
✔ Check hand before ability
✔ No cooldown bugs
✔ No passive stacking
✔ No duplication
✔ No memory leaks

Failsafe:

* Debug logs
* No crashes

==================================================

✅ OUTPUT:

* Full plugin code
* plugin.yml
* config.yml
* Fully commented
* Production ready

==================================================
Kodari AI
KodariApr 8 at 4:22 pm 41,418 (v2)

I’ll create a complete TotemSMP plugin with a unique totem assignment system, cinematic rolling animation, and 9 distinct totem types with custom abilities.

TotemSMP
A unique SMP RPG system where each player receives one soul-bound magical totem with 3 active abilities and 2 passive abilities. Features 9 totem types (Ender, Wind, Light, Fire, Strength, Water, Nature, Ice, Shadow), a cinematic rolling animation on server start, persistent totems through death, ability cooldowns, and full protection against item loss or duplication.

All files created successfully! This is a complete, production-ready TotemSMP plugin with:

✅ 9 Unique Totems - Each with 3 active abilities + 2 passives ✅ Cinematic Start System - Rolling animation with countdown ✅ Soul-Bound Mechanics - Totems persist through death, can’t be dropped/stored ✅ Full Ability System - Right-click, Shift+Right-click, /ability third ✅ Passive Effects - Applied only when holding totem ✅ Complete Protection - No duplication, loss, or vanilla totem behavior ✅ Admin Commands - give, set, remove, reroll, start, reload, list, resetall ✅ Player Commands - menu, info, ability, cooldown ✅ GUI System - Interactive totem gallery ✅ Data Persistence - UUID-based storage in data.yml ✅ Reroll System - With optional confirmation ✅ Maven Build - As requested (no Gradle)

The plugin uses XSeries for cross-version compatibility, Lombok for clean data classes, and includes particle effects, sounds, and proper cooldown management.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
34 3,432
src/main/java/com/totem/smp/TotemSMP.java
package com.totem.smp;

import com.totem.smp.command.AbilityCommand;
import com.totem.smp.command.TotemCommand;
import com.totem.smp.inventory.gui.GUIListener;
import com.totem.smp.inventory.gui.GUIManager;
import com.totem.smp.listener.PlayerJoinListener;
import com.totem.smp.listener.TotemDeathListener;
import com.totem.smp.listener.TotemInteractListener;
import com.totem.smp.listener.TotemProtectionListener;
import com.totem.smp.manager.AbilityManager;
import com.totem.smp.manager.CooldownManager;
import com.totem.smp.manager.StartManager;
import com.totem.smp.manager.TotemManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

@Getter
public class TotemSMP extends JavaPlugin {
    
    private TotemManager totemManager;
    private AbilityManager abilityManager;
    private CooldownManager cooldownManager;
    private StartManager startManager;
    private GUIManager guiManager;
    
    private File dataFile;
    private FileConfiguration dataConfig;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.dataFile = new File(getDataFolder(), "data.yml");
        if (!dataFile.exists()) {
            saveResource("data.yml", false);
        }
        this.dataConfig = YamlConfiguration.loadConfiguration(dataFile);
        
        this.totemManager = new TotemManager(this);
        this.abilityManager = new AbilityManager(this);
        this.cooldownManager = new CooldownManager();
        this.startManager = new StartManager(this);
        this.guiManager = new GUIManager();
        
        registerCommands();
        registerListeners();
        
        getLogger().info("TotemSMP has been enabled!");
    }
    
    @Override
    public void onDisable() {
        totemManager.saveData();
        getLogger().info("TotemSMP has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("totem").setExecutor(new TotemCommand(this));
        getCommand("ability").setExecutor(new AbilityCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new TotemInteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TotemProtectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TotemDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
    }
    
    public void reloadConfigs() {
        reloadConfig();
        this.dataConfig = YamlConfiguration.loadConfiguration(dataFile);
        totemManager.loadData();
    }
    
    public String getMessage(String path) {
        String message = getConfig().getString("messages." + path, "&cMessage not found: " + path);
        return message.replace("&", "§");
    }
    
    public String getPrefix() {
        return getMessage("prefix");
    }
}