Class TextUtils

java.lang.Object
net.kamkeyke.raccooncore.util.TextUtils

public class TextUtils extends Object
Utility class containing helper methods for building formatted text Components.

This class centralizes common text formatting logic used across commands, messages and UI-related things.

  • Constructor Details

    • TextUtils

      public TextUtils()
  • Method Details

    • buildPlayerList

      public static net.minecraft.network.chat.Component buildPlayerList(Collection<? extends net.minecraft.world.entity.player.Player> players)
      Builds a human-readable Component containing the display names of the provided players.
      • 1 player → Player
      • 2 players → Player1 and Player2
      • 3+ players → Player1, Player2 and Player3

      The returned component preserves each player's display name formatting and defers translation resolution to the client.

      Parameters:
      players - the collection of players whose names should be formatted
      Returns:
      a formatted Component representing the player list