ProfileUtils
in package
Provides methods to generate a MinecraftProfile from a username or UUID.
Tags
Table of Contents
Methods
- formatUUID() : string
- Add dashes to UUID.
- getOfflineModeUuid() : array<string|int, mixed>
- Generate an offline minecraft UUID v3 based on the case sensitive player name.
- getProfile() : MinecraftProfile|null
- Get a MinecraftProfile from a username or UUID.
- getUUIDFromUsername() : array<string|int, mixed>
- Get a Minecraft UUID from a Minecraft username.
Methods
formatUUID()
Add dashes to UUID.
public
static formatUUID(string $uuid) : string
Parameters
- $uuid : string
-
string UUID to format
Return values
string —Properly formatted UUID (According to UUID v4 Standards xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx WHERE y = 8,9,A,or B and x = random digits.)
getOfflineModeUuid()
Generate an offline minecraft UUID v3 based on the case sensitive player name.
public
static getOfflineModeUuid(string $username) : array<string|int, mixed>
Parameters
- $username : string
Return values
array<string|int, mixed>getProfile()
Get a MinecraftProfile from a username or UUID.
public
static getProfile(string $identifier) : MinecraftProfile|null
Parameters
- $identifier : string
-
Either the player's Username or UUID.
Return values
MinecraftProfile|null —Returns null if fetching of profile failed. Else returns completed user profile.
getUUIDFromUsername()
Get a Minecraft UUID from a Minecraft username.
private
static getUUIDFromUsername(string $username) : array<string|int, mixed>
Parameters
- $username : string
-
Minecraft username.
Return values
array<string|int, mixed> —(Key => Value) "username" => Minecraft username (properly capitalized) "uuid" => Minecraft UUID or null