abhijeetog_og
📎 1 file 6,998 chars
📄
pasted-code-1775622295860.txt
txt 371 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 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).

Totem item:

* Base item: Totem of Undying
* Must use Custom Model Data (for resource pack textures)

Each player can ONLY have ONE totem.

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

TOTEM TYPES (9 TOTAL):

1. Ender Totem (Void / Space)
2. Wind Totem (Air / Speed)
3. Light Totem (Energy / Lightning)
4. Fire Totem (Destruction / Flame)
5. Strength Totem (Power / Combat)
6. Water Totem (Flow / Healing)
7. Nature Totem (Life / Forest)
8. Ice Totem (Freeze / Time)
9. Shadow Totem (Dark / Stealth)

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

ABILITY SYSTEM:

Each totem must have:

ACTIVE ABILITIES (3):

1. Ability 1 → Triggered by Right Click
2. Ability 2 → Triggered by Shift + Right Click
3. Ability 3 → Triggered by command: /ability third

IMPORTANT:

* Ability 3 must be the MOST POWERFUL (Ultimate)
* Each ability must have its own cooldown
* Cooldowns must be tracked per player

ABSOLUTE REQUIREMENT:

* All abilities MUST be COMPLETELY UNIQUE
* DO NOT copy vanilla mechanics (no simple potion-only abilities)
* Use custom effects like:

  * Velocity manipulation
  * Area effects
  * Custom damage systems
  * Particle animations
  * Sound effects

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

PASSIVE ABILITY SYSTEM:

Each totem has 2 passive abilities.

CRITICAL CONDITION:
Passive abilities ONLY work when:

* Totem is in MAIN HAND OR
* Totem is in OFFHAND

If the totem is NOT held:
→ ALL passive abilities must be instantly removed

IMPLEMENTATION:

* Run a repeating task every 10–20 ticks
* Check player’s held items
* Apply/remove effects dynamically
* Prevent stacking or duplication bugs

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

SMP START SYSTEM (CINEMATIC):

Command:
/totem start

Functionality:

1. Lock all players:

   * Disable movement
   * Disable damage
   * Optional: disable chat

2. Countdown:
   "SMP starting in 5...4...3...2...1..."

3. Rolling Animation:

   * Show INVENTORY GUI or title animation
   * Display all 9 totems spinning randomly
   * Duration: 3–5 seconds
   * Must slow down before stopping

4. Random Assignment:

   * Assign each player ONE random totem
   * Save using UUID

5. Effects:

   * Play sounds (tick + reward)
   * Show particles

6. Announcements:
   " has been chosen by the "

7. Unlock players:

   * SMP officially starts

RULES:

* Can only run once
* Add force mode:
  /totem start force

Permission:
totem.start

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

COMMAND SYSTEM:

Base command: /totem

PLAYER COMMANDS:

* /totem menu → Open INVENTORY GUI showing all totems
* /totem info → Show current totem info
* /totem ability → Show abilities + cooldowns
* /totem cooldown → Show cooldown timers

ABILITY COMMAND:

* /ability third → triggers ultimate ability

Conditions:

* Player must hold totem
* Must not be on cooldown

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

ADMIN COMMANDS:

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

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

PERMISSIONS:

totem.admin
totem.give
totem.set
totem.remove
totem.reroll
totem.reload
totem.use
totem.menu
totem.info
totem.start
totem.ability

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

REROLL SYSTEM:

* Removes current totem
* Assigns new random totem

OPTIONS:

* Confirmation system
* Broadcast message
* Blacklist certain totems (config)

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

ITEM RESTRICTIONS (CRITICAL – NO BYPASS):

The totem must be completely bound to the player.

RESTRICTIONS:

1. Cannot be dropped
   → Cancel PlayerDropItemEvent

2. Cannot be stored in:

   * Chest
   * Ender Chest
   * Barrel
   * Shulker Box
   * Hopper

3. Cannot be moved:

   * No shift-click
   * No dragging
   * No number key swapping

4. Must be bound to player:

   * Store UUID using PersistentDataContainer

5. If another player gets it:

   * Disable usage OR return to owner

6. Death handling:

   * Prevent dropping (configurable)

7. Show message:
   "This totem is bound to your soul and cannot be moved!"

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

TOTEM ITEM LORE (VERY IMPORTANT):

Each totem must include detailed lore explaining:

* Totem Name
* Theme
* All 3 Active Abilities:

  * Name
  * Description
  * HOW TO USE (Right Click / Shift Right Click / Command)
* Passive abilities
* Optional cooldown info

Example format:

[Fire Totem]

Active Abilities:

* Flame Wave (Right Click): Sends fire forward
* Inferno Mode (Shift + Right Click): Area fire attack
* Hell Collapse (/ability third): Massive ultimate attack

Passive:

* Fire immunity
* Burns enemies on hit

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

INVENTORY GUI SYSTEM:

* /totem menu
* Inventory INVENTORY GUI (3x3)
* Each slot = one totem
* Show:

  * Name
  * Description
  * Abilities

Highlight:

* Player’s totem → glowing effect

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

COOLDOWN SYSTEM:

* Use HashMap or similar
* Track:

  * Player UUID
  * Ability type
  * Time remaining

Display via:

* Action bar
* Chat messages

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

DATA STORAGE:

* Store player totem using UUID
* File:

  * data.yml OR config.yml

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

CONFIG SYSTEM:

Include options for:

* Cooldowns
* Enable/disable totems
* Reroll blacklist
* Messages
* Death drop toggle

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

TECHNICAL REQUIREMENTS:

* Clean OOP design

* Separate classes:

  * Main
  * TotemManager
  * AbilityManager
  * CooldownManager
  * CommandHandler
  * GUIManager

* Use enums for totems

* Use event listeners:

  * PlayerInteractEvent
  * PlayerJoinEvent
  * PlayerDropItemEvent
  * InventoryClickEvent
  * InventoryDragEvent
  * PlayerDeathEvent

* Use PersistentDataContainer for item identification

* Optimize performance

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

OUTPUT REQUIRED:

* Full working plugin code
* plugin.yml
* Main class
* Config file
* Proper comments

==================================================
Kodari AI
KodariApr 8 at 4:32 am 45,966 (v2)

I’ll create a comprehensive TotemSMP plugin with 9 unique totems, each with distinct abilities, a cinematic start system, and complete protection mechanisms.

TotemSMP
An immersive RPG-style SMP enhancement where players are bound to magical totems granting unique powers. Features 9 distinct totem types (Ender, Wind, Light, Fire, Strength, Water, Nature, Ice, Shadow), each with 3 active abilities and 2 passive effects. Includes cinematic totem assignment ceremony, inventory GUI system, comprehensive cooldown tracking, and advanced item protection to prevent trading or dropping. Complete with admin tools, player commands, and persistent data storage.

I’ll create a complete production-ready TotemSMP plugin with 9 unique totems, cinematic start system, and comprehensive protection.

Complete TotemSMP plugin created with all requested features! The plugin includes:

✅ 9 Unique Totems with completely distinct abilities (no simple potion effects) ✅ Active Abilities System (Right-click, Shift+Right-click, /ability third) ✅ Passive Abilities (only active when totem is held in main/offhand) ✅ Cinematic SMP Start with rolling animation and countdown ✅ Complete Item Binding (cannot drop, store, or trade totems) ✅ Inventory GUI System for totem menu and rolling animation ✅ Comprehensive Commands (/totem, /ability with all subcommands) ✅ Cooldown Tracking with configurable durations ✅ Data Persistence (data.yml with UUID-based storage) ✅ Maven Configuration (pom.xml with Paper API, XSeries, Lombok) ✅ Full Permission System defined in plugin.yml ✅ Configurable Messages and settings

All abilities use XSeries for cross-version compatibility, comprehensive particle effects, sounds, and unique mechanics like velocity manipulation, area effects, custom damage, teleportation, and entity spawning. The plugin is production-ready with proper OOP design and complete protection against totem exploitation.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
25 2,862
src/main/java/com/totemsmp/plugin/TotemSMP.java
package com.totemsmp.plugin;

import com.totemsmp.plugin.commands.AbilityCommand;
import com.totemsmp.plugin.commands.TotemCommand;
import com.totemsmp.plugin.inventory.gui.GUIListener;
import com.totemsmp.plugin.inventory.gui.GUIManager;
import com.totemsmp.plugin.listeners.PlayerDeathListener;
import com.totemsmp.plugin.listeners.PlayerJoinListener;
import com.totemsmp.plugin.listeners.TotemInteractListener;
import com.totemsmp.plugin.listeners.TotemProtectionListener;
import com.totemsmp.plugin.managers.AbilityManager;
import com.totemsmp.plugin.managers.CooldownManager;
import com.totemsmp.plugin.managers.PassiveManager;
import com.totemsmp.plugin.managers.StartManager;
import com.totemsmp.plugin.managers.TotemManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class TotemSMP extends JavaPlugin {
    private TotemManager totemManager;
    private AbilityManager abilityManager;
    private CooldownManager cooldownManager;
    private PassiveManager passiveManager;
    private StartManager startManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager();
        this.totemManager = new TotemManager(this);
        this.abilityManager = new AbilityManager(this);
        this.passiveManager = new PassiveManager(this);
        this.startManager = new StartManager(this);
        this.guiManager = new GUIManager();
        
        registerCommands();
        registerListeners();
        
        this.passiveManager.startTask();
        
        getLogger().info("TotemSMP has been enabled!");
    }

    @Override
    public void onDisable() {
        if (this.passiveManager != null) {
            this.passiveManager.stopTask();
        }
        if (this.totemManager != null) {
            this.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 GUIListener(this.guiManager), this);
        Bukkit.getPluginManager().registerEvents(new TotemInteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TotemProtectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
    }
    
    public void reloadPlugin() {
        reloadConfig();
        this.totemManager.loadData();
    }
}