获取位置
这个模块致力于提供用于定位任意真实玩家位置的 API。
要使用此处的 API,你必须已经在你的环境中设置好了 MCDReforged 。
- location_api.pos.get_dimension_from_server_reply(content: str, player: str | None = None, regex: str | None = None) str | None[源代码]
从像这样的文本内容中解析出一个维度字符串:
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[源代码]
从像这样的文本内容中解析出一个
Point3D实例:CleMooling has the following entity data: [-524.5d, 71.0d, -66.5d]
- location_api.pos.safe_parse_dim(dim_str: str, player: str) str[源代码]
一个包装器,用于从字符串(服务器回复的 RCON 命令结果)中获取维度字符串。
实际上调用
get_dimension_from_server_reply。- 参数:
dim_str -- 要解析的字符串。
player -- 玩家的名字。
- 返回:
解析后的维度字符串,实际上是一个
Result对象。