skullgamer0706

design a premium-style Team plugin for Paper 1.21.8 with:

* /team INVENTORY GUI (main menu like the image) * Custom INVENTORY GUI exactly styled like shown (top row icons + loot bag section) * Custom colored team armor * Team power system * Friendly fire toggle (INVENTORY GUI controlled) * Team homes + teleport * Role permissions (Owner, Co-Owner, Member) * Fully configurable config.yml * Clean, expandable structure (better than most public plugins)

Plugin Name: TeamX

---

πŸ“ Project Structure

java
package com.teamx;

import org.bukkit.plugin.java.JavaPlugin;
import com.teamx.manager.TeamManager;
import com.teamx.commands.TeamCommand;
import com.teamx.listeners.GUIListener;
import com.teamx.listeners.FriendlyFireListener;

public class TeamX extends JavaPlugin {

    private static TeamX instance;
    private TeamManager teamManager;

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

        teamManager = new TeamManager(this);

        getCommand("team").setExecutor(new TeamCommand(this));
        getServer().getPluginManager().registerEvents(new GUIListener(this), this);
        getServer().getPluginManager().registerEvents(new FriendlyFireListener(this), this);

        getLogger().info("TeamX Enabled Successfully!");
    }

    public static TeamX getInstance() {
        return instance;
    }

    public TeamManager getTeamManager() {
        return teamManager;
    }
}

---

πŸ”₯ 1️⃣ Main Class

yaml
name: TeamX
version: 1.0
main: com.teamx.TeamX
api-version: 1.21
author: PremiumDev

commands:
  team:
    description: Main team command
    usage: /team

---

πŸ“œ plugin.yml

yaml
settings:
  friendly-fire: false
  max-team-size: 10
  default-power: 10
  power-per-kill: 1
  power-per-death: -1

armor:
  enabled: true
  color: RED

messages:
  no-team: "&cYou are not in a team!"
  team-created: "&aTeam created successfully!"
  friendly-fire-enabled: "&aFriendly Fire Enabled!"
  friendly-fire-disabled: "&cFriendly Fire Disabled!"
  home-set: "&aTeam home set!"
  teleported-home: "&aTeleported to team home!"

INVENTORY GUI:
  title: "&8Main Menu"
  size: 54

---

βš™οΈ config.yml (Fully Customizable)

java
package com.teamx.INVENTORY GUI;

import org.bukkit.*;
import org.bukkit.inventory.*;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.entity.Player;
import com.teamx.TeamX;

public class TeamMainGUI {

    public static void open(Player player) {

        Inventory inv = Bukkit.createInventory(null, 54,
                ChatColor.translateAlternateColorCodes('&',
                        TeamX.getInstance().getConfig().getString("INVENTORY GUI.title")));

        // TOP MENU ITEMS (Like Image)
        inv.setItem(10, create(Material.CRAFTING_TABLE, "Β§eTeam Settings"));
        inv.setItem(11, create(Material.CLOCK, "Β§aTeam Power"));
        inv.setItem(12, create(Material.PAPER, "Β§bMembers"));
        inv.setItem(13, create(Material.ENDER_CHEST, "Β§6Team Home"));
        inv.setItem(14, create(Material.GOLD_INGOT, "Β§eFriendly Fire"));
        inv.setItem(15, create(Material.IRON_SWORD, "Β§cToggle PvP"));

        // Bottom section "Loot bag"
        inv.setItem(31, create(Material.CHEST, "Β§dLoot Bag"));

        player.openInventory(inv);
    }

    private static ItemStack create(Material mat, String name) {
        ItemStack item = new ItemStack(mat);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(name);
        item.setItemMeta(meta);
        return item;
    }
}

---

πŸ–₯️ INVENTORY GUI (EXACT STYLE LIKE IMAGE)

Top row icons styled like shown:

java
package com.teamx.commands;

import org.bukkit.command.*;
import org.bukkit.entity.Player;
import com.teamx.TeamX;
import com.teamx.INVENTORY GUI.TeamMainGUI;

public class TeamCommand implements CommandExecutor {

    private TeamX plugin;

    public TeamCommand(TeamX plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd,
                             String label, String[] args) {

        if (!(sender instanceof Player)) return true;
        Player player = (Player) sender;

        if (args.length == 1 && args[0].equalsIgnoreCase("INVENTORY GUI")) {
            TeamMainGUI.open(player);
            return true;
        }

        // Normal team commands
        if (args.length == 2 && args[0].equalsIgnoreCase("create")) {
            plugin.getTeamManager().createTeam(player, args[1]);
        }

        return true;
    }
}

βœ” Same chest-style layout βœ” Top row icons βœ” Bottom loot bag section βœ” 54 slots βœ” Customizable title

---

🎯 /team Command

java
package com.teamx.listeners;

import org.bukkit.event.*;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.entity.Player;
import com.teamx.TeamX;

public class FriendlyFireListener implements Listener {

    private TeamX plugin;

    public FriendlyFireListener(TeamX plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onDamage(EntityDamageByEntityEvent e) {
        if (!(e.getDamager() instanceof Player)) return;
        if (!(e.getEntity() instanceof Player)) return;

        Player attacker = (Player) e.getDamager();
        Player victim = (Player) e.getEntity();

        if (plugin.getTeamManager().sameTeam(attacker, victim)) {
            if (!plugin.getConfig().getBoolean("settings.friendly-fire")) {
                e.setCancelled(true);
            }
        }
    }
}

---

βš” Friendly Fire Toggle

java
package com.teamx.utils;

import org.bukkit.*;
import org.bukkit.inventory.*;
import org.bukkit.inventory.meta.LeatherArmorMeta;

public class ArmorColorUtil {

    public static ItemStack colorArmor(Material mat, Color color) {
        ItemStack item = new ItemStack(mat);
        LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
        meta.setColor(color);
        item.setItemMeta(meta);
        return item;
    }
}

---

πŸ›‘ Custom Colored Armor

java
public void setHome(Player player) {
    Team team = getTeam(player);
    team.setHome(player.getLocation());
}

public void teleportHome(Player player) {
    Team team = getTeam(player);
    player.teleport(team.getHome());
}

When a player joins team β†’ auto-apply colored armor based on config.

---

🏠 Team Home System (Basic Example)

java
public enum Role {
    OWNER,
    CO_OWNER,
    MEMBER
}

---

πŸ‘‘ Role Permissions System

Inside Team.java:

code
TeamX/
 β”œβ”€β”€ TeamX.java
 β”œβ”€β”€ commands/
 β”‚    └── TeamCommand.java
 β”œβ”€β”€ INVENTORY GUI/
 β”‚    └── TeamMainGUI.java
 β”œβ”€β”€ manager/
 β”‚    β”œβ”€β”€ TeamManager.java
 β”‚    β”œβ”€β”€ HomeManager.java
 β”‚    └── PowerManager.java
 β”œβ”€β”€ model/
 β”‚    └── Team.java
 β”œβ”€β”€ listeners/
 β”‚    β”œβ”€β”€ GUIListener.java
 β”‚    └── FriendlyFireListener.java
 β”œβ”€β”€ utils/
 β”‚    └── ArmorColorUtil.java
 β”œβ”€β”€ plugin.yml
 └── config.yml

Only OWNER can:

* Disband team * Toggle friendly fire * Set home * Promote players

---

πŸ’Ž Premium Features Included

βœ” INVENTORY GUI Controlled toggles βœ” Fully configurable βœ” Power system βœ” Custom armor βœ” Team homes βœ” Roles βœ” Clean API structure βœ” Expandable for database (MySQL ready) βœ” Compatible with Paper 1.21.8 *

Kodari AI
KodariFeb 12 at 12:55 pm 851 (v2)
TeamX
A premium team management plugin for Minecraft servers on Paper 1.21.8. Enables players to create and manage teams with features like custom GUIs, power systems, friendly fire controls, team homes with teleportation, role-based permissions (Owner, Co-Owner, Member), and configurable colored armor. Includes a fully customizable config.yml and a clean, expandable structure ready for database integration.
skullgamer0706

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/teamx/TeamX.java at line 5: cannot find symbol
import com.teamx.listeners.GUIListener;
                          ^
  symbol: class GUIListener
  location: package com.teamx.listeners

ERROR in   src/main/java/com/teamx/TeamX.java at line 5: cannot find symbol
  import com.teamx.listeners.GUIListener;
                            ^
  symbol: class GUIListener
  location: package com.teamx.listeners

ERROR in src/main/java/com/teamx/TeamX.java at line 5: cannot find symbol
import com.teamx.listeners.GUIListener;
                          ^
  symbol: class GUIListener
  location: package com.teamx.listeners


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - GUIListener
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/teamx/TeamX.java
  -   src/main/java/com/teamx/TeamX.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 12 at 12:56 pm 818 (v2)
skullgamer0706

Create a config file,plugin.yml file,messages.yml,INVENTORY GUI.yml file to configure messages, materials,INVENTORY GUI edit etc

Kodari AI
KodariFeb 12 at 12:57 pm 887 (v2)
skullgamer0706

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 6 error(s):

ERROR in src/main/java/com/teamx/TeamX.java at line 34: constructor GUIManager in class GUIManager cannot be applied to given types;
        guiManager = new GUIManager(this);
                     ^

ERROR in src/main/java/com/teamx/INVENTORY GUI/TeamMainGUI.java at line 22: cannot find symbol
        return Bukkit.createInventory(null, 54, ColorUtil.colorize(TeamX.getInstance().getConfig().getString("INVENTORY GUI.title", "<dark_gray>Team Menu")).content());
                                                                                                                                                  ^
  symbol: method content()
  location: interface Component

ERROR in   src/main/java/com/teamx/TeamX.java at line 34: constructor GUIManager in class GUIManager cannot be applied to given types;
          guiManager = new GUIManager(this);
                       ^

ERROR in   src/main/java/com/teamx/INVENTORY GUI/TeamMainGUI.java at line 22: cannot find symbol
          return Bukkit.createInventory(null, 54, ColorUtil.colorize(TeamX.getInstance().getConfig().getString("INVENTORY GUI.title", "<dark_gray>Team Menu")).content());
                                                                                                                                                    ^
  symbol: method content()
  location: interface Component

ERROR in src/main/java/com/teamx/TeamX.java at line 34: constructor GUIManager in class GUIManager cannot be applied to given types;
        guiManager = new GUIManager(this);
                     ^

ERROR in src/main/java/com/teamx/INVENTORY GUI/TeamMainGUI.java at line 22: cannot find symbol
        return Bukkit.createInventory(null, 54, ColorUtil.colorize(TeamX.getInstance().getConfig().getString("INVENTORY GUI.title", "<dark_gray>Team Menu")).content());
                                                                                                                                                  ^
  symbol: method content()
  location: interface Component


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - content()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/teamx/TeamX.java
  - src/main/java/com/teamx/INVENTORY GUI/TeamMainGUI.java
  -   src/main/java/com/teamx/TeamX.java
  -   src/main/java/com/teamx/INVENTORY GUI/TeamMainGUI.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 12 at 12:59 pm 1,783 (v2)

What classes will I call methods on?

For the GUIManager constructor issue in TeamX.java, I need to check GUIManager’s constructor signature.

For the ColorUtil.colorize().content() issue in TeamMainGUI.java, I need to check ColorUtil’s colorize method return type and if Component has content().

Classes: GUIManager, ColorUtil, TeamMainGUI, TeamX.

Reading: GUIManager.java, ColorUtil.java, TeamMainGUI.java, TeamX.java.

skullgamer0706

Explain all the commands and there use and what is there work

Kodari AI
KodariFeb 12 at 1:00 pm 407 (v2)

Commands in TeamX Plugin

The TeamX plugin has one main command: /team. This command is player-only (cannot be used from console) and serves as the entry point for team management. Below is a breakdown of its usage and functionality based on the code.

Main Command: /team

  • Usage: /team

  • Description: Opens the main team GUI (graphical interface) for the player.

  • Work:

    • If the player is not in a team, the GUI shows a β€œCreate Team” option.

    • If the player is in a team, the GUI displays team-related options like settings, power, members, home teleport, friendly fire toggle, PvP toggle, and loot bag access.

    • The GUI uses buttons for interaction, but these are not separate commandsβ€”they’re handled within the GUI system.

Subcommand: /team create <name>

  • Usage: /team create <team_name> (e.g., /team create MyTeam)

  • Description: Creates a new team with the specified name.

  • Work:

    • Calls the TeamManager to create the team and assign the player as the owner.

    • Requires exactly 2 arguments: β€œcreate” and the team name.

    • If successful, the player becomes the team owner; otherwise, it may fail silently or handle errors internally (based on TeamManager logic).

Subcommand: /team home

  • Usage: /team home

  • Description: Teleports the player to their team’s home location.

  • Work:

    • Calls the HomeManager to teleport the player.

    • Only works if the player is in a team and a home has been set.

    • If no home is set or the player isn’t in a team, it may fail or provide feedback (handled by HomeManager).

Subcommand: /team sethome

  • Usage: /team sethome

  • Description: Sets the team’s home location to the player’s current position.

  • Work:

    • Calls the HomeManager to set the home.

    • Requires the player to be in a team (likely as owner or with permissions).

    • Saves the location for future teleports via /team home.

Notes:

  • All subcommands require the player to be in a team for most actions (except creating one).

  • The GUI provides visual access to features like toggling friendly fire (owner-only), viewing team power, and accessing shared loot, but these are not command-basedβ€”they’re button clicks in the inventory GUI.

  • If invalid arguments are provided, the command returns false, which may show the default usage message.

  • The plugin uses managers (TeamManager, HomeManager) to handle the backend logic for these commands.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
21 771
src/main/java/com/teamx/TeamX.java
package com.teamx;

import com.teamx.commands.TeamCommand;
import com.teamx.gui.GUIListener;
import com.teamx.gui.GUIManager;
import com.teamx.listeners.FriendlyFireListener;
import com.teamx.manager.HomeManager;
import com.teamx.manager.PowerManager;
import com.teamx.manager.TeamManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class TeamX extends JavaPlugin {

    @Getter
    private static TeamX instance;
    @Getter
    private TeamManager teamManager;
    @Getter
    private HomeManager homeManager;
    @Getter
    private PowerManager powerManager;
    @Getter
    private GUIManager guiManager;

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

        teamManager = new TeamManager(this);
        homeManager = new HomeManager(this);
        powerManager = new PowerManager(this);
        guiManager = new GUIManager();

        getCommand("team").setExecutor(new TeamCommand(this));
        getServer().getPluginManager().registerEvents(new GUIListener(this), this);
        getServer().getPluginManager().registerEvents(new FriendlyFireListener(this), this);

        getLogger().info("TeamX Enabled Successfully!");
    }

    @Override
    public void onDisable() {
        getLogger().info("TeamX Disabled!");
    }
}