Skip to content

NameUtil ​

com.jsmacrosce.jsmacros.util.NameUtil

Since1.8.4

Utilities for guessing player names and roles from chat-message prefixes.

Methods ​

guessNameAndRoles ​

static guessNameAndRoles(String text): List<String>#
Guesses a player name and preceding roles from at most the first 60 characters of a chat message. Returns an empty list when no supported prefix pattern is recognized.

Parameters:

  • text: chat message to inspect
Returns: guessed roles and player name, or an empty list when no supported prefix is recognized