外观
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 TagListSDK 说明:
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 TestForMatchSDK 说明:
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 CommandQueriesSDK 说明:
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,
) -> OperationIntentSDK 说明:
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) -> OperationIntentCommandQueries.scores
python
def scores(self, name: str, *, idempotency_key: str, deadline: str) -> OperationIntentSDK 说明:
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,
) -> OperationIntentCommandQueries.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 TickingAreasSDK 说明:
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,
) -> OperationIntentTickingAreas.add_circle
python
def add_circle(
self,
name: str,
center,
radius: int,
*,
idempotency_key: str,
deadline: str,
preload: bool = False,
) -> OperationIntentTickingAreas.remove
python
def remove(self, name: str, *, idempotency_key: str, deadline: str) -> OperationIntentTickingAreas.list
python
def list(
self,
*,
idempotency_key: str,
deadline: str,
all_dimensions: bool = False,
) -> OperationIntentTickingAreas.operations
python
self.operations公开实例属性,在 __init__ 中设置。
TickingAreas.commands
python
self.commands公开实例属性,在 __init__ 中设置。