public static OfflinePlayer parsePlayer(final Context context, final int position) {
        if (position < 0 || context.arguments.size() <= position) return null;

        String query = context.arguments.get(position).toLowerCase();
        final boolean isExact = !query.endsWith("*"); // Trailing asterisk indicates to use first player name found beginning with characters before asterisk
        if (!isExact) query = query.substring(0, query.length() - 1); // Strip trailing asterisk

        for (final OfflinePlayer op : Bukkit.getServer().getOfflinePlayers()) {
            final String name = (op.getPlayer() != null ? op.getPlayer().getName() : op.getName()).toLowerCase();
            if (isExact) {
                if (name.equals(query)) return op;

                continue;
            }

            // Return first matching player name starting with query characters
            if (name.startsWith(query)) return op;
        }

        return null;
    }