Skip to content

A simple Python lib to get player info and texture from Mojang and Yggdrasil APIs. / 一个简单的 Python 库,可从 Mojang 和 Yggdrasil APIs 获取玩家的信息和材质。

License

Notifications You must be signed in to change notification settings

SerinaNya/yggdrasil-mc

Repository files navigation

yggdrasil-mc

GitHub Repo stars PyPI PyPI - Python Version GitHub last commit (branch) GitHub

A simple Python lib to get player info and texture from Mojang and Yggdrasil APIs.

一个简单的 Python 库,可从 Mojang 和 Yggdrasil APIs 获取玩家的信息和材质。

Attention

This package can run in Python 3.10+ ONLY.

Usage

  1. Download the package from PyPI

    pip3 install -U yggdrasil-mc
  2.  from yggdrasil_mc import YggdrasilPlayer
    
     player_name = "w84"
     ygg = YggdrasilPlayer()
     player = ygg.Uuid.getMojang(player_name)
     if player.existed:
         print(ygg.Profile.getMojang(player.id))

After you run these snippet, you will get the following output:

id='ca244462f8e5494791ec98f0ccf505ac' name='w84' properties=Properties(...

Note that this package also provide the asyncio version which is powered by aiohttp:

from yggdrasil_mc import YggdrasilPlayer

player_name = "w84"
ygg = YggdrasilPlayer()
player = await ygg.Uuid.getMojangAsync(player_name)
if player.existed:
    print(await ygg.Profile.getMojangAsync(player.id))

About

A simple Python lib to get player info and texture from Mojang and Yggdrasil APIs. / 一个简单的 Python 库,可从 Mojang 和 Yggdrasil APIs 获取玩家的信息和材质。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages