abhijeetog_og
📎 1 file 5,145 chars
📄
pasted-code-1775542770771.txt
txt 268 lines
▶
Create a fully functional Minecraft SMP plugin using Java (Spigot/Paper API).

PLUGIN NAME: TotemSMP

---

CORE CONCEPT:

There are 9 unique magical totems in the SMP. Each player is assigned exactly one totem when they join the server for the first time. The totem grants special powers.

Each totem has:

* 2 Active Abilities
* 2 Passive Abilities

The totem item must be a "Totem of Undying" with custom model data (for resource pack textures).

---

TOTEM LIST:

1. Ender Totem (Teleportation / Void)
2. Wind Totem (Speed / Movement)
3. Light Totem (Lightning / Energy)
4. Fire Totem (Flame / Nether)
5. Strength Totem (Combat / Power)
6. Water Totem (Healing / Ocean)
7. Nature Totem (Regeneration / Forest)
8. Ice Totem (Freeze / Control)
9. Shadow Totem (Stealth / Darkness)

---

ABILITY SYSTEM:

Each totem must include:

ACTIVE ABILITIES:

* Ability 1 → Triggered by Right Click
* Ability 2 → Triggered by Shift + Right Click
* Each ability must have its own cooldown system
* Cooldowns must be tracked per player

PASSIVE ABILITIES:

* Always active
* Implement using potion effects, attributes, or event listeners

Abilities should be visually rich using particles and sound effects.

---

FIRST JOIN SYSTEM:

* Detect if player is joining for the first time
* Assign a random totem
* Save the assigned totem permanently
* Send a message:
  "You have been chosen by the "

---

COMMAND SYSTEM:

Base command: /totem

PLAYER COMMANDS:

* /totem menu → Opens INVENTORY GUI showing all totems
* /totem info → Shows player's current totem and abilities
* /totem ability → Shows ability list and cooldown status
* /totem cooldown → Displays remaining cooldown timers
* /totem reroll (optional) → Requires special item (Reroll Token)

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

---

REROLL SYSTEM:

* Admin command: /totem reroll 
* Removes current totem and assigns a new random one
* Should support:

  * Optional confirmation system
  * Optional broadcast message
  * Blacklist certain totems in config

---

INVENTORY GUI SYSTEM (/totem menu):

* Use a 3x3 inventory INVENTORY GUI
* Each slot represents one totem
* Show:

  * Totem name
  * Description
  * Abilities
* Player's current totem should:

  * Have enchantment glow
  * Be clearly highlighted

---

COOLDOWN SYSTEM:

* Store cooldowns using HashMap or similar structure
* Track per player and per ability
* Display cooldowns via:

  * Action bar
  * Chat messages

---

DATA STORAGE:

* Store player totem data persistently
* Use:

  * config.yml OR
  * separate data.yml file
* Save using UUID

---

CONFIG FILE FEATURES:

Include configurable options:

* Ability cooldown durations
* Enable/disable specific totems
* Blacklist totems from reroll
* Messages customization
* Toggle for totem drop on death

---

ITEM RESTRICTIONS (CRITICAL FEATURE):

The totem must be completely bound to the player and cannot be moved, dropped, or stored.

Implement the following:

1. Prevent dropping:

   * Cancel PlayerDropItemEvent

2. Prevent storage in containers:

   * Block placing in:

     * Chests
     * Ender Chests
     * Barrels
     * Shulker Boxes
     * Hoppers
   * Cancel InventoryClickEvent and InventoryDragEvent

3. Prevent movement:

   * Block shift-click
   * Block number key swaps
   * Block dragging

4. Optional:

   * Force the totem to stay in offhand slot

5. Bind to player:

   * Store player UUID using PersistentDataContainer

6. Ownership protection:

   * If another player gets the item:

     * Either disable it OR
     * Return it to the owner

7. Death handling:

   * Prevent dropping on death (configurable)

8. Feedback:

   * Show message if player tries to move:
     "This totem is bound to your soul and cannot be moved!"

---

TECHNICAL IMPLEMENTATION:

* Use clean Object-Oriented Programming (OOP)

* Create separate classes:

  * Main plugin class
  * TotemManager
  * AbilityManager
  * CommandHandler
  * GUIManager
  * CooldownManager

* Use enums for all totem types

* Use event listeners for:

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

* Use PersistentDataContainer for item identification

* Optimize for performance

---

OPTIONAL ADVANCED FEATURES:

* Totem leveling system
* Special particles and sound effects
* Boss fights requiring specific totems
* Totem-based factions or teams
* Reroll Token item system

---

OUTPUT REQUIREMENTS:

Provide:

* Full working Java plugin code
* plugin.yml file
* Main class
* Example config.yml
* Comments in code explaining functionality

---
Kodari AI
KodariApr 7 at 6:24 am 29,396 (v2)

I’ll create a comprehensive TotemSMP plugin with 9 unique magical totems, each with active and passive abilities.

TotemSMP
A magical totem-based SMP plugin where players are assigned one of 9 unique totems with special abilities. Each totem grants 2 active abilities (right-click and shift+right-click) and 2 passive effects. Features include a comprehensive GUI system, cooldown management, persistent data storage, admin commands, and complete item protection to prevent totems from being dropped or stored. Totems are bound to players using custom model data.

Complete TotemSMP plugin created with 9 unique magical totems, each featuring 2 active abilities (right-click and shift+right-click) and passive effects. The plugin includes a full command system, inventory GUI, cooldown management, persistent data storage, complete item protection, and admin controls.

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

import com.totemsmp.ability.AbilityManager;
import com.totemsmp.ability.CooldownManager;
import com.totemsmp.command.TotemCommand;
import com.totemsmp.inventory.gui.GUIListener;
import com.totemsmp.inventory.gui.GUIManager;
import com.totemsmp.listener.PlayerJoinListener;
import com.totemsmp.listener.TotemInteractListener;
import com.totemsmp.listener.TotemProtectionListener;
import com.totemsmp.totem.TotemManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

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

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.totemManager = new TotemManager(this);
        this.cooldownManager = new CooldownManager(this);
        this.abilityManager = new AbilityManager(this);
        this.guiManager = new GUIManager();
        
        getCommand("totem").setExecutor(new TotemCommand(this));
        
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new TotemInteractListener(this), this);
        getServer().getPluginManager().registerEvents(new TotemProtectionListener(this), this);
        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        
        getLogger().info("TotemSMP has been enabled!");
    }

    @Override
    public void onDisable() {
        if (totemManager != null) {
            totemManager.saveAllData();
        }
        getLogger().info("TotemSMP has been disabled!");
    }
}