Skip to content

Instantly share code, notes, and snippets.

@yushijinhun
yushijinhun / minecraft-offline-uuid.php
Created July 8, 2018 03:32 — forked from games647/minecraft-offline-uuid.php
Generate an offline minecraft UUID v3 based on the case sensitive player name
<?
/**
* 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));