跳转到正文

command_queries API ​

完整接口目录 · 命令与计分板用法 · 工具包下载

模块说明 ​

text
Prepare Bedrock queries without IO; interpret only known message-key shapes.

T ​

python
T = TypeVar('T')

CommandQueryResult ​

python
@dataclass(frozen=True)
class CommandQueryResult(Generic[T])

SDK 说明:

text
None means unrecognized/unavailable, never an empty or zero observation.

command retains the original receipt, including failed and unknown states.
Parsing does not bind a receipt to an intent: pass the matching query receipt.

字段(包含继承字段):

CommandQueryResult.command ​

python
command: CommandResult

数据类字段;声明于 command_queries.CommandQueryResult。

CommandQueryResult.value ​

python
value: T | None = None

数据类字段;声明于 command_queries.CommandQueryResult。

CommandQueryResult.reason ​

python
reason: str = 'unrecognized_output'

数据类字段;声明于 command_queries.CommandQueryResult。

CommandQueryResult.known ​

python
@property
def known(self) -> bool

另继承外部类型 Generic[T];其通用方法不在本 SDK 目录中重复展开。

TagList ​

python
@dataclass(frozen=True)
class TagList

SDK 说明:

text
Server count and display text; comma-delimited text is not exact tag IDs.

字段(包含继承字段):

TagList.target_display ​

python
target_display: str

数据类字段;声明于 command_queries.TagList。

TagList.count ​

python
count: int

数据类字段;声明于 command_queries.TagList。

TagList.display_text ​

python
display_text: str

数据类字段;声明于 command_queries.TagList。

ScoreEntry ​

python
@dataclass(frozen=True)
class ScoreEntry

字段(包含继承字段):

ScoreEntry.objective ​

python
objective: str

数据类字段;声明于 command_queries.ScoreEntry。

ScoreEntry.display_name ​

python
display_name: str

数据类字段;声明于 command_queries.ScoreEntry。

ScoreEntry.value ​

python
value: int

数据类字段;声明于 command_queries.ScoreEntry。

ScoreList ​

python
@dataclass(frozen=True)
class ScoreList

字段(包含继承字段):

ScoreList.target_display ​

python
target_display: str

数据类字段;声明于 command_queries.ScoreList。

ScoreList.entries ​

python
entries: tuple[ScoreEntry, ...]

数据类字段;声明于 command_queries.ScoreList。

TestForMatch ​

python
@dataclass(frozen=True)
class TestForMatch

SDK 说明:

text
One raw server display parameter; not player identities or an entity count.

字段(包含继承字段):

TestForMatch.display_text ​

python
display_text: str

数据类字段;声明于 command_queries.TestForMatch。

CommandQueries ​

python
class CommandQueries

SDK 说明:

text
All builders need framework.command.execute, caller keys and deadlines.

These queries use the normal command gate and command feedback. They neither
change feedback settings nor bypass admission, and never submit or retry.

CommandQueries.__init__ ​

python
def __init__(self, operations: Operations)

CommandQueries.item_count ​

python
def item_count(
    self,
    name: str,
    item: str,
    *,
    idempotency_key: str,
    deadline: str,
    data: int = -1,
) -> OperationIntent

SDK 说明:

text
Count matching items with maxCount=0; do not remove any item.

CommandQueries.tags ​

python
def tags(self, name: str, *, idempotency_key: str, deadline: str) -> OperationIntent

CommandQueries.scores ​

python
def scores(self, name: str, *, idempotency_key: str, deadline: str) -> OperationIntent

SDK 说明:

text
List objective scores for one exact-name player resolved at execution.

CommandQueries.testfor ​

python
def testfor(
    self,
    selector: str,
    *,
    idempotency_key: str,
    deadline: str,
) -> OperationIntent

CommandQueries.parse_item_count ​

python
@staticmethod
def parse_item_count(receipt) -> CommandQueryResult[int]

CommandQueries.parse_tags ​

python
@staticmethod
def parse_tags(receipt) -> CommandQueryResult[TagList]

CommandQueries.parse_scores ​

python
@staticmethod
def parse_scores(receipt) -> CommandQueryResult[ScoreList]

CommandQueries.parse_testfor ​

python
@staticmethod
def parse_testfor(receipt) -> CommandQueryResult[TestForMatch]

CommandQueries.operations ​

python
self.operations

公开实例属性,在 __init__ 中设置。

CommandQueries.commands ​

python
self.commands

公开实例属性,在 __init__ 中设置。

TickingAreas ​

python
class TickingAreas

SDK 说明:

text
Bounded named area command intents; list output stays a CommandResult.

Coordinates and removal apply in the executor's dimension. Add/remove modify
the world. A command acknowledgement does not prove chunks are loaded.

TickingAreas.__init__ ​

python
def __init__(self, operations: Operations)

TickingAreas.add_box ​

python
def add_box(
    self,
    name: str,
    start,
    end,
    *,
    idempotency_key: str,
    deadline: str,
    preload: bool = False,
) -> OperationIntent

TickingAreas.add_circle ​

python
def add_circle(
    self,
    name: str,
    center,
    radius: int,
    *,
    idempotency_key: str,
    deadline: str,
    preload: bool = False,
) -> OperationIntent

TickingAreas.remove ​

python
def remove(self, name: str, *, idempotency_key: str, deadline: str) -> OperationIntent

TickingAreas.list ​

python
def list(
    self,
    *,
    idempotency_key: str,
    deadline: str,
    all_dimensions: bool = False,
) -> OperationIntent

TickingAreas.operations ​

python
self.operations

公开实例属性,在 __init__ 中设置。

TickingAreas.commands ​

python
self.commands

公开实例属性,在 __init__ 中设置。

Neomega · 使用、开发与参考文档