API Reference¶
EMC¶
EarthMC is a large Minecraft server this package lets you get info about things on that server.
- class emc.Nation(name: str, *, data: Optional[Tuple[dict, dict]] = None)¶
A nation
- Parameters
name (str) – The name of the nation to get
data (tuple[dict,dict]) – Data from
emc.util.get_data()
- Raises
NationNotFoundException – The nation could not be found
- colour: str¶
The colour that the towns in the nation appear on the map. Standard hex colour code
- name: str¶
The name of the nation
- class emc.Resident(name: str, *, data: Optional[Tuple[dict, dict]] = None)¶
A person
- Parameters
name (str) – The name of the resident to search for
data (tuple[dict,dict]) – Data from
emc.util.get_data()town – Internal use only, will be removed in v1.3
Weather or not the resident can be seen on the map
- name: str¶
The name of the resident
- nation: Nation¶
The nation that the resident’s town is in, None if the resident is townless or the town nationless
- online: bool¶
Weather or not the resident is online
- position: tuple[int, int, int]¶
The position of the resident, (0, 64, 0) if hidden == True
- class emc.Town(name: str, *, data: Optional[Tuple[dict, dict]] = None)¶
A town
- Parameters
name (str) – The name of the town to look for
data (tuple[dict,dict]) – Data from
emc.util.get_data()
- Raises
TownNotFoundException – The town could not be found
- colour: str¶
The colour that the town appears on the map. Standard hex colour code
- flags: dict[str, bool]¶
The flags of the town. pvp, mobs, explosions, fire, capital
- name: str¶
The name of the town
Util¶
Utilities to help with other modules
- emc.util.get_data() → Tuple[dict, dict]¶
Returns the map data. Useful for making multiple requests
- Returns
The map data
- Return type
tuple[dict,dict]
- emc.util.map_link(position: Tuple[float, Any, float], zoom: int = 6) → str¶
Return a link to the map at the specified position
- Parameters
position (tuple[float,Any,float]) – The position to return a map link to, only the first and last items are used
zoom (int) – The zoom level, must be between 0 and 8
- Returns
The link to the map
- Return type
str