timoffeybitskoff-byte

Can you make a plugin where i can assign teams by doing /team set %player% and then either red blue purple yellow green black white and orange and in a team no players can kill eachother on and it shows there nametag in the color i set and also add a /setplayerspawn %player% x y z coords and they respawn there and i can also do /teampawn set (team)x y z coords

Kodari AI
KodariJul 13 at 9:14 pm 7
TeamSpawnManager
TeamSpawnManager is a lightweight Bukkit/Paper plugin for organizing players into red, blue, purple, yellow, green, black, white, and orange teams. Administrators assign a player with /team set, automatically apply a matching colored nametag, and prevent teammates from damaging one another, including projectile attacks. The plugin stores team assignments, supports personal respawn locations through /setplayerspawn, and supports shared team respawn locations through /teampawn set, with coordinates persisted across restarts.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
13 765
src/main/java/com/kodari/teamspawn/TeamSpawnPlugin.java
package com.kodari.teamspawn;

import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class TeamSpawnPlugin extends JavaPlugin {
    private TeamManager teamManager;
    private SpawnManager spawnManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        teamManager = new TeamManager(this);
        teamManager.load();

        spawnManager = new SpawnManager(this);
        spawnManager.load();

        PluginCommand teamCommand = getCommand("team");
        if (teamCommand != null) {
            TeamCommand executor = new TeamCommand(this);
            teamCommand.setExecutor(executor);
            teamCommand.setTabCompleter(executor);
        }

        PluginCommand playerSpawnCommand = getCommand("setplayerspawn");
        if (playerSpawnCommand != null) {
            playerSpawnCommand.setExecutor(new PlayerSpawnCommand(this));
        }

        PluginCommand teamSpawnCommand = getCommand("teampawn");
        if (teamSpawnCommand != null) {
            TeamSpawnCommand executor = new TeamSpawnCommand(this);
            teamSpawnCommand.setExecutor(executor);
            teamSpawnCommand.setTabCompleter(executor);
        }

        getServer().getPluginManager().registerEvents(new GameplayListener(this), this);
    }

    @Override
    public void onDisable() {
        if (teamManager != null) {
            teamManager.shutdown();
        }
    }

    public TeamManager getTeamManager() {
        return teamManager;
    }

    public SpawnManager getSpawnManager() {
        return spawnManager;
    }
}