I
πŸ“Ž 1 file 9,435 chars
πŸ“„
pasted-code-1790494472279.txt
txt 450 lines
β–Ά
Create a complete Minecraft Paper plugin called **DefectTeamEvent**.

The plugin is a clean team-management and **Defect Team Event** system.

All plugin messages, command help, errors, confirmations, and event messages should clearly use the branding:

**Defect Team Event**

Do not use the old name **TeamLastSurvive** anywhere in the plugin.

---

# 1. Team System

Players should be able to create and manage teams.

### Commands

`/team create `

* Creates a new team.
* The player who creates it becomes the normal team owner/leader.
* Maximum team size is 5 players.

`/team invite `

* Sends a team invitation.
* Only the team owner/leader can invite.
* Cannot invite anyone if the team already has 5 members.
* A player cannot belong to multiple teams.

`/team accept `

* Accepts a team invitation.
* Cannot join if the team already has 5 members.

`/team kick `

* Removes a player from the team.
* Only the team owner/leader can use it.

`/team leave`

* Allows a player to leave their current team.

`/team disband`

* Disbands the team.
* Only the team owner/leader can use it.

`/team color `

* Changes the team's color.
* Only the team owner/leader can use it.

`/team info`

* Shows the team's name, color, owner, members, and alliance information.

`/team`

* Shows the player's current team information.

All command messages should be branded as **Defect Team Event**.

---

# 2. Team Limit

Every team has a strict maximum of **5 players**.

* Maximum team size: 5.
* The team owner counts as one player.
* A 6th player must never be allowed to join.
* `/team invite` must refuse when the team is full.
* `/team accept` must refuse when the team is full.

---

# 3. Team Colors

Support standard Minecraft team colors, including:

* Red
* Blue
* Green
* Yellow
* Aqua
* Purple
* White
* Black
* Gray
* And other standard Minecraft colors.

The selected color should be used wherever the team name is displayed.

---

# 4. Team Alliance System

Add:

`/team ally `

Only the team owner/leader can send an alliance request.

Example:

`/team ally Blue`

This sends an alliance request to the **Blue Team owner/leader**.

The receiving team must accept the request.

Add:

`/team ally accept `

Only the receiving team's owner/leader can accept the request.

Once accepted:

* Both teams become allies.
* The alliance works in both directions.
* The alliance remains active until removed.
* Alliance data must survive server restarts.

Add:

`/team ally remove `

Only the team owner/leader can remove an existing alliance.

---

# 5. Alliance TAB Display

TAB must clearly show alliance information.

If Red Team is allied with Blue Team, Red Team members should see:

`Allied with Blue Team`

Blue Team members should see:

`Allied with Red Team`

If a team has multiple allies, display all allied teams.

Example:

`Allied with: Blue Team, Green Team`

Use the actual team colors when displaying allied team names.

Do not show alliance information for teams that are not allied.

---

# 6. Alliance Combat Rules

Allied teams cannot damage each other's normal members.

Example:

Red Team normal member β†’ CANNOT damage β†’ Blue Team normal member.

However, there is one important exception:

### Event Leader vs Event Leader

Event Leaders can always attack and kill other teams' Event Leaders, even if their teams are allied.

Allowed:

`Red Event Leader β†’ Blue Event Leader`

Not allowed:

`Red normal member β†’ Blue normal member`

`Red Event Leader β†’ Blue normal member`

`Red normal member β†’ Blue Event Leader`

The only cross-team combat allowed between allied teams is:

**Event Leader vs Event Leader**

This protection must work with:

* Melee attacks
* Bows
* Crossbows
* Tridents
* Projectiles
* Other normal player damage sources

Do not block combat between teams that are NOT allied.

---

# 7. Defect Team Event

Add the main admin command:

`/defectteamevent`

This command must be **ADMIN/OP ONLY**.

This starts the **Defect Team Event**.

Also make the command recognizable as the main event command in `/help`.

When `/defectteamevent` is started:

* The event begins.
* Every existing team gets exactly ONE random Event Leader.
* The Event Leader must be randomly selected from that team's current members.
* The normal team owner does NOT automatically become the Event Leader.
* Every team must have exactly one Event Leader.

Example:

Red Team:

* Player1
* Player2
* Player3
* Player4
* Player5

The plugin randomly selects Player3.

Player3 becomes the **Defect Team Event Leader** for Red Team.

---

# 8. Event Leader TAB

The randomly selected Event Leader should be clearly identified in TAB.

Example:

`[Red Team Owner] Player3`

Use the team's actual color.

Another example:

`[Blue Team Owner] Player7`

Important:

The normal team owner should NOT receive this label unless they are randomly selected as the Event Leader.

The "Team Owner" label in this context represents the randomly selected event leader.

Do not give multiple players the Event Leader designation for the same team.

---

# 9. Leader Death

During the Defect Team Event:

If an Event Leader dies:

* The entire team is immediately eliminated.
* Every member of that team becomes eliminated.
* The team is marked as eliminated.
* The eliminated team can no longer participate.
* The Event Leader status is removed.
* Do not automatically select another leader.
* The team remains eliminated until an admin uses the revive command.

Important:

Only the death of the randomly selected Event Leader eliminates the team.

If a normal team member dies, the team does NOT get eliminated.

---

# 10. Team Revive

Add the admin-only command:

`/defectteamrevive `

Example:

`/defectteamrevive Red`

This command can only be used by OP/admins.

When used on an eliminated team:

* Restore the entire team.
* Remove the team's eliminated status.
* Allow all team members to participate again.
* Select a NEW random Event Leader.
* Update TAB immediately.
* The new Event Leader receives the Event Leader designation.

Example:

`[Red Team Owner] PlayerName`

If the team is already active, show an appropriate **Defect Team Event** message.

If the team does not exist, show an appropriate error.

---

# 11. Event Rules

Once `/defectteamevent` has started:

* Do not automatically restart the event.
* Do not assign multiple Event Leaders to one team.
* Do not randomly change Event Leaders during the event.
* Eliminated teams remain eliminated until revived.
* Revived teams receive a new random Event Leader.
* If the new Event Leader dies, the team is eliminated again.
* Maximum team size remains 5.
* Existing alliances remain active.
* Allied normal members cannot damage each other.
* Allied Event Leaders can fight each other.
* Event Leaders from different allied teams can kill each other.

---

# 12. Persistence

Save all data properly so it survives server restarts.

Save:

* Teams
* Team members
* Team owners
* Team colors
* Team alliances
* Pending alliance requests
* Event status
* Eliminated teams
* Current Event Leaders

Do not reset any of this data after a restart.

---

# 13. Branding

The plugin's display name should be:

**Defect Team Event**

Use this name in:

* Command responses
* Error messages
* Success messages
* Team event announcements
* Alliance messages
* Revive messages
* Event Leader messages
* Help messages
* Console messages where appropriate

Examples:

`[Defect Team Event] Your team has been created!`

`[Defect Team Event] Red Team is now allied with Blue Team.`

`[Defect Team Event] Red Team has been eliminated!`

`[Defect Team Event] Red Team has been revived by an administrator.`

`[Defect Team Event] Player3 is the Event Leader of Red Team.`

Do NOT use `TeamLastSurvive` anywhere.

---

# 14. Commands Summary

Player commands:

`/team`

`/team create `

`/team invite `

`/team accept `

`/team kick `

`/team leave`

`/team disband`

`/team color `

`/team info`

`/team ally `

`/team ally accept `

`/team ally remove `

Admin commands:

`/defectteamevent`

`/defectteamrevive `

All admin commands must require OP/admin permission.

---

# 15. Important Restrictions

Keep the plugin simple, clean, and optimized.

Do NOT add:

* Abilities
* Kits
* Custom items
* Economy
* Scoreboards
* Extra GUI systems
* Unnecessary potion effects
* Team buffs
* Leader glowing effects
* Random gameplay mechanics

The core gameplay should be:

**Create Team β†’ Maximum 5 Players β†’ Invite/Kick/Manage β†’ Choose Team Color β†’ Ally With Other Teams β†’ Alliance Protection β†’ Start Defect Team Event β†’ Random Event Leader β†’ Event Leader Death Eliminates Entire Team β†’ Admin Can Revive Team β†’ New Random Event Leader β†’ TAB Shows Teams, Colors, Event Leaders, and Allied Teams.**

Make all messages configurable in `config.yml`.

Use a modern Paper API and compile the plugin as a ready-to-use `.jar`.
Kodari AI
KodariSep 28 at 12:51 pm 1
DefectTeamEvent
DefectTeamEvent is a team-management and event plugin for Paper servers. Players create teams with a strict 5-member limit, choose colors, and form alliances. The plugin features a complete alliance system with bidirectional relationships, TAB display showing allied teams in their colors, and combat protection preventing allied members from damaging each other. The core event system randomly selects one Event Leader per team; if that leader dies, the entire team is eliminated. Admins can revive eliminated teams, which triggers selection of a new random Event Leader. All team data, alliances, event status, and leader assignments persist across restarts. The plugin includes full team management commands, admin-only event commands, configurable branded messages, and clear TAB indicators for team ownership and event leadership.

Created the Defect Team Event Paper plugin project with team management, persistent alliances, alliance combat protection, randomized event leaders, elimination/revive handling, and colored TAB displays. Messages are configurable in config.yml; admin commands require OP or defectteamevent.admin.

Build the jar with gradle build; output is build/libs/DefectTeamEvent-1.0.0.jar.

I

bhai tab mai bhi nhi dikhrha /team create /team colours /team kick nhi arha + team event wala bhi nhi arha ally wala bhi nhi arha + tab mai bhi nhi dikhra team leader woh hoga jisne team bnayi hogi + random wala hatadoo plz tab wghera fix kroo i want this plugin fix in 1min

Kodari AI
KodariSep 28 at 12:59 pm 1
  1. Fix command declarations/registration for /team subcommands, alliance commands, and event commands.

  2. Make the team creator the permanent event leader; remove random leader selection.

  3. Fix TAB team/leader/alliance display and keep it updated.

Fixes applied:

  • /team now autocompletes commands, including ally, kick, and both color and colors; /team colors <color> also works.

  • The Event Leader is now the team owner/creatorβ€”random selection is removed, including on revive.

  • TAB shows the owner before the event, the active Event Leader during the event, and allied teams in their colors.

Rebuild with gradle build, replace the old jar, and fully restart the server for the changes to take effect.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
13 1,236
src/main/java/com/defectteamevent/DefectTeamEventPlugin.java
package com.defectteamevent;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class DefectTeamEventPlugin extends JavaPlugin {
    private TeamManager teamManager;
    private MessageService messages;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        messages = new MessageService(this);
        teamManager = new TeamManager(this);

        TeamCommand teamCommand = new TeamCommand(teamManager, messages);
        getCommand("team").setExecutor(teamCommand);
        getCommand("team").setTabCompleter(teamCommand);

        EventAdminCommand eventCommand = new EventAdminCommand(teamManager, messages);
        getCommand("defectteamevent").setExecutor(eventCommand);
        getCommand("defectteamevent").setTabCompleter(eventCommand);
        getCommand("defectteamrevive").setExecutor(eventCommand);
        getCommand("defectteamrevive").setTabCompleter(eventCommand);

        Bukkit.getPluginManager().registerEvents(new TeamEventListener(teamManager, messages), this);
        TabDisplay.updateAll(teamManager);
        getLogger().info("[Defect Team Event] Plugin enabled.");
    }

    @Override
    public void onDisable() {
        if (teamManager != null) {
            teamManager.save();
        }
        getLogger().info("[Defect Team Event] Plugin disabled.");
    }
}