EntityPlayer player = ...; // get reference to a player entity UUID uuid = player.getUniqueID(); // get player's unique identifier
EntityPlayer player1 = ...; // get reference to player 1 entity EntityPlayer player2 = ...; // get reference to player 2 entity boolean samePlayer = player1.getUniqueID().equals(player2.getUniqueID()); // compare unique identifiersThis code example shows how to compare the unique identifiers of two player entities to determine if they represent the same player. The `equals()` method of the `UUID` class is used to compare the identifiers. Package Library: `net.minecraft.entity.player`