Get Position
This module aims to provide apis to locate the position of any actual player.
To use APIs here, you must have set up MCDReforged in your environment.
- location_api.pos.get_dimension_from_server_reply(content: str, player: str | None = None, regex: str | None = None) str | None[source]
Extracts a dimension string from a text content, like this:
CleMooling has the following entity data: minecraft:overworld
- location_api.pos.get_point3d_from_server_reply(content: str, player_name: str | None = None, regex: str | None = None) Point3D | None[source]
Extracts a
Point3Dinstance from a text content, like this:CleMooling has the following entity data: [-524.5d, 71.0d, -66.5d]- Parameters:
- Returns:
- Raises:
TypeError – If the 3d point cannot be extracted.
- location_api.pos.safe_parse_dim(dim_str: str, player: str) str[source]
A wrapper to get a dimension string from a string(rcon command result as server reply).
Actually calls
get_dimension_from_server_reply.- Parameters:
dim_str – The string to parse.
player – The name of the player.
- Returns:
The parsed dimension string, but actually a
Resultobject.