public static UniqueIdType determineType(UUID uniqueId, LuckPermsPlugin plugin) {
        // determine initial type based on the uuid version
        String type;
        switch (uniqueId.version()) {
            case 4:
                type = UniqueIdDetermineTypeEvent.TYPE_AUTHENTICATED;
                break;
            case 3:
                type = UniqueIdDetermineTypeEvent.TYPE_UNAUTHENTICATED;
                break;
            case 2:
                // if the uuid is version 2, assume it is an NPC
                // see: https://github.com/LuckPerms/LuckPerms/issues/1470
                // and https://github.com/LuckPerms/LuckPerms/issues/1470#issuecomment-475403162
                type = UniqueIdDetermineTypeEvent.TYPE_NPC;
                break;
            default:
                type = UniqueIdDetermineTypeEvent.TYPE_UNKNOWN;
                break;
        }

        // call the event
        type = plugin.getEventDispatcher().dispatchUniqueIdDetermineType(uniqueId, type);

        switch (type) {
            case UniqueIdDetermineTypeEvent.TYPE_AUTHENTICATED:
                return AUTHENTICATED;
            case UniqueIdDetermineTypeEvent.TYPE_UNAUTHENTICATED:
                return UNAUTHENTICATED;
            case UniqueIdDetermineTypeEvent.TYPE_NPC:
                return NPC;
            case UniqueIdDetermineTypeEvent.TYPE_UNKNOWN:
                return UNKNOWN;
            default:
                return new UniqueIdType(type);
        }
    }
Encapsulates the type of a players unique id.
common/src/main/java/me/lucko/luckperms/common/util/UniqueIdType.java