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
Release history Release notifications | RSS feed
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.6.tar.gz
(2.7 kB
view hashes)