PHPackages                             sven/minecraft-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sven/minecraft-php

AbandonedArchivedLibrary[API Development](/categories/api)

sven/minecraft-php
==================

A fluent wrapper around Mojang's Minecraft API.

v0.0.4(8y ago)2392MITPHPPHP ^5.5 || ^7.0

Since Jan 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/svenluijten/minecraft-php)[ Packagist](https://packagist.org/packages/sven/minecraft-php)[ RSS](/packages/sven-minecraft-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Minecraft API
=============

[](#minecraft-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b16517a9b1cb154f58ad7f8b9b55e3e5775c298ae4d71bd20309b30336a24be1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7376656e2f6d696e6563726166742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/minecraft-php)[![Total Downloads](https://camo.githubusercontent.com/53ba05db2433c800c8e8569c829a89ebbb866696157c056f7342bf89c39d6ede/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7376656e2f6d696e6563726166742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/minecraft-php)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This is a simple package providing you with all the tools to quickstart development on that Minecraft site you've been craving. Retrieve UUIDs based on usernames or the other way around with a simple and human-readable API.

Install
-------

[](#install)

Via [composer](http://getcomposer.org):

```
$ composer require sven/minecraft-php
```

If you're using the [Laravel](http://laravel.com) framework, you can add the `MinecraftServiceProvider` to your `providers` array:

```
// config/app.php
'providers' => [
    ...
    Sven\Minecraft\MinecraftServiceProvider::class,
    ...
];
```

You may also add the `Minecraft` facade to the `aliases` array to use the facade:

```
// config/app.php
'aliases' => [
    ...
    'Minecraft' => Sven\Minecraft\Facades\Minecraft::class,
    ...
];
```

Usage
-----

[](#usage)

```
$minecraft = new Sven\Minecraft\Minecraft;

// Build up the user object from a given username.
$minecraft->fromName($username);

// Supply an optional UNIX timestamp to get the user object of the player who
// owned that username at the time.
$minecraft->fromName($username, time() - (365 * 24 * 60 * 60));

// Build up the user object from a given UUID.
$minecraft->fromUuid($uuid);
```

If you specified the alias in `config/app.php`, you can use the facade:

```
Minecraft::fromName($username);

Minecraft::fromUuid($uuid);
```

This always returns you the same object (`Sven\Minecraft\Minecraft`). You may use the `get()` and `only($property)` methods on it to retrieve the data:

```
$minecraft = new Minecraft;
$user = $minecraft->fromName('jeb_');

$user->get()->name;  // jeb_
$user->get()->uuid;  // 853c80ef3c3749fdaa49938b674adae6

$user->only('name'); // jeb_
$user->only('uuid'); // 853c80ef3c3749fdaa49938b674adae6
```

If you want more flexibility, the `->get()` method returns a JSON object of data for your user:

```
$user->get(); // {"name": "jeb_", "uuid": "853c80ef3c3749fdaa49938b674adae6"}
```

Rate limiting
-------------

[](#rate-limiting)

Mojang has some rate limiting in place so you are expected to cache the results. You may send **1 request per minute** to the same resource, and you may request as many unique resources as you'd like. Keep in mind Mojang might change this at any time.

Credits
-------

[](#credits)

This is simply a wrapper around [Mojang](https://mojang.com)'s API, beautifully (yet unofficially) documented at [http://wiki.vg/Mojang\_API](http://wiki.vg/Mojang_API).

License
-------

[](#license)

`sven/minecraft-php` is licensed under the MIT License (MIT). Please see the [license file](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~167 days

Total

4

Last Release

3275d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.5.9

v0.0.3PHP ^5.5 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6682e025b83b7a93b4d43c5c9b0b2245d790d72352758c47b81ba14858f45a8a?d=identicon)[svenluijten](/maintainers/svenluijten)

---

Top Contributors

[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (21 commits)")

---

Tags

apiminecraftMojang

### Embed Badge

![Health badge](/badges/sven-minecraft-php/health.svg)

```
[![Health](https://phpackages.com/badges/sven-minecraft-php/health.svg)](https://phpackages.com/packages/sven-minecraft-php)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)[navarr/minecraft-profile

Minecraft Profile API

241.5k](/packages/navarr-minecraft-profile)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
