riley radomski

create a minecraft plugin where there is a command to make groups and each group gets a color of glowing around them not the effect give an outline, people who have /op can create and delete the groups and add and remove players from them, the people wiht /op can toggle the colored outline on and off, if a player is in a group, they cannot attck another player in the same group as them

Kodari AI
KodariOct 13 at 2:24 am 3
GroupGlowOutline
A Minecraft plugin that creates colored glowing outlines around group members. Administrators with /op can create and delete groups, assign colors to each group, add or remove players, and toggle the outline visibility on and off. Players in the same group cannot attack each other, enforced through damage prevention. The plugin uses the Adventure API to render colored outlines using the player model's glow texture, providing a visual identifier for group membership while preventing friendly fire between group members.

I created the plugin with six files: plugin.yml, GroupOutlinePlugin, Group, GroupManager, GroupListener, and GroupCommand.

Commands (all require op, via the groupoutline.admin permission defaulting to op):

  • /group create <name> [color]: group names are 1-12 letters, numbers, or underscores. If you skip the color, the next unused one is assigned.

  • /group delete <name>

  • /group add <name> <player>: a player can only be in one group at a time.

  • /group remove <name> <player>

  • /group list: shows groups, colors, members, and whether outlines are on.

  • /group outline [on|off]: with no argument, it toggles the outlines for all groups.

How it works:

  • Colored outline: each group is a scoreboard team set to its color, and members get the glowing flag. The outline takes the team’s color. No potion effect is applied.

  • No attacking teammates: melee hits and projectiles between members of the same group are cancelled, and the attacker sees a message. Explosions and other damage sources are not blocked.

  • Persistence: groups, members, and the outline setting are saved to groups.yml and restored on restart.

Things to know:

  • Outline colors only show for viewers who use the main scoreboard. Players running another plugin’s scoreboard will see a white outline.

  • /group add only works for players who have joined the server before.

riley radomski

make it so the glow outline is the color not the name tags or chat meesages

Kodari AI
KodariOct 13 at 2:36 am 1

Chat messages from group members now show a plain white name instead of the group color. The outline still uses the group color.

  • Chat: GroupListener.onChat runs at the highest priority and replaces the sender’s display name in the chat format with their plain username, but only for players who are in a group.

  • Outline: unchanged. It still uses the group’s scoreboard team color.

Name tags are still colored. In Minecraft, the glow outline and the name tag both take their color from the scoreboard team, so I can’t make the outline colored while keeping name tags white. The only option that stays within vanilla is hiding name tags for group members. That would remove their name tags entirely rather than keep them white. Do you want that?

riley radomski

no

Kodari AI
KodariOct 13 at 2:37 am 1

Got it, I’ll leave the name tags as they are. Members keep their colored name tags, and the chat change and team-colored outline stay as they were.

riley radomski

just make it so the outline is colored and not white

Kodari AI
KodariOct 13 at 2:40 am 1

The outline was white for anyone whose scoreboard wasn’t the main one, because the group teams only existed on the main scoreboard. Other plugins often give players their own scoreboard, so those players never saw the team color.

  • GroupManager: every group team is now created and kept in sync on the main scoreboard and on each online player’s own scoreboard. Membership and color changes apply to all of them, and deleting a group removes its team from all of them.

  • GroupOutlinePlugin: a task re-syncs the teams every 2 seconds, so a plugin that swaps a player’s scoreboard after they join gets the team added back.

I haven’t tested this on a server. If a player’s outline is still white after a couple of seconds, their scoreboard is being replaced in a way the sync can’t reach, and I’d need to know which plugin sets their scoreboard.

Kodari can make mistakes. Review important code before using.
Files
src
Code
6 636
src/main/java/com/example/groupoutline/GroupOutlinePlugin.java
package com.example.groupoutline;

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

public class GroupOutlinePlugin extends JavaPlugin {

    private GroupManager groupManager;

    @Override
    public void onEnable() {
        groupManager = new GroupManager(this);
        groupManager.load();

        GroupCommand groupCommand = new GroupCommand(this);
        PluginCommand command = getCommand("group");
        if (command != null) {
            command.setExecutor(groupCommand);
            command.setTabCompleter(groupCommand);
        }
        getServer().getPluginManager().registerEvents(new GroupListener(this), this);
        getServer().getScheduler().runTaskTimer(this, groupManager::syncScoreboards, 40L, 40L);
    }

    @Override
    public void onDisable() {
        if (groupManager != null) {
            groupManager.save();
        }
    }

    public GroupManager getGroupManager() {
        return groupManager;
    }
}