Skip to content

Instantly share code, notes, and snippets.

Avatar

Fodor Benedek RedyAu

View GitHub Profile
@games647
games647 / minecraft-offline-uuid.php
Last active Jan 23, 2022
Generate an offline minecraft UUID v3 based on the case sensitive player name
View minecraft-offline-uuid.php
<?
/**
* Generates a offline-mode player UUID.
*
* @param $username string
* @return string
*/
public static function constructOfflinePlayerUuid($username) {
//extracted from the java code:
//new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));