Class PlayerUtils

java.lang.Object
me.yleoft.zAPI.utils.PlayerUtils

public abstract class PlayerUtils extends Object
Utility class for player-related operations.
  • Constructor Details

    • PlayerUtils

      public PlayerUtils()
  • Method Details

    • getOfflinePlayer

      public static org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull UUID uuid)
      Retrieves an OfflinePlayer by name, using the Folia API if available.
      Parameters:
      uuid - the name of the player
      Returns:
      the OfflinePlayer object, or null if not found
    • getOfflinePlayer

      public static org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull String name)
      Retrieves an OfflinePlayer by name, using the Folia API if available.
      Parameters:
      name - the name of the player
      Returns:
      the OfflinePlayer object, or null if not found
    • performCommand

      public static void performCommand(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String command, boolean chanceParsed)
      Performs a custom command to the player or console.
      Parameters:
      player - the player to perform the command as, or null for console
      command - the command to perform
      chanceParsed - whether the command has already been parsed for chance
    • performCommand

      public static void performCommand(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String command)
    • performCommand

      public static void performCommand(@Nullable @Nullable org.bukkit.entity.Player p, @NotNull @NotNull List<String> commands)