Skip to main content

Provides info on the EarthMC Minecraft server.

Project description

EarthMC Package

Provides info on the EarthMC Minecraft server.

Installation

$ pip install earthmc

Import and instantiate classes

from EarthMC import towns, nations, players

towns = towns()
nations = nations()
players = players()

Methods

Player Related

Get all online players

onlinePlayers = players.allOnline()

print(onlinePlayers)

# => [{"x": 0, "y": 64, "z": 0, "isUnderground": true, "nickname": "PlayerNickname", "name": "PlayerName"}, ...]

Get an online player

op = players.getOnlinePlayer("PlayerName")

print(op)

# => {"x": 0, "y": 64, "z": 0, "isUnderground": true, "nickname": "PlayerNickname", "name": "PlayerName"}

Town Related

Get all towns

allTowns = towns.all()

print(allTowns)

# => [{ area: 975, x: -352, z: -9904, name: 'TownName', nation: 'NationName', mayor: 'MayorName', residents: ['Resident', 'OtherResident', ...], pvp: false, mobs: false, public: false, explosion: false, fire: false, capital: true }, ...]

Get a town by name

town = towns.get("TownName")

print(town)

# => { area: 975, x: -352, z: -9904, name: 'TownName', nation: 'NationName', mayor: 'MayorName', residents: ['Resident', 'OtherResident', ...], pvp: false, mobs: false, public: false, explosion: false, fire: false, capital: true }

Nation Related

Get all nations

allNations = nations.all()

print(allNations)

# => [{ name: 'NationName', residents: ['Resident', 'OtherResident', ...], towns: ['Town', 'OtherTown', ...], king: 'KingName', capitalName: 'CapitalName', capitalX: -352, capitalZ: -9904, area: 7289 }, ...]

Get a nation by name

nation = nations.get("NationName")

print(nation)

# => { name: 'NationName', residents: ['Resident', 'OtherResident', ...], towns: ['Town', 'OtherTown', ...], king: 'KingName', capitalName: 'CapitalName', capitalX: -352, capitalZ: -9904, area: 7289 }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EarthMC-1.0.5.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

EarthMC-1.0.5-py2-none-any.whl (2.9 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page