跳转到正文

crossbow_inventory API ​

完整接口目录 · 目标与战斗用法 · 工具包下载

模块说明 ​

text
Native slot evidence only: no loading timer, writes, firing or hit inference.

CrossbowInventoryObservations ​

python
class CrossbowInventoryObservations

SDK 说明:

text
Single-owner projection bound to one connection and caller-declared IDs.

Caller must resolve crossbow/arrow NetworkIDs for this connection. This API
does not discover item names. max_age_ms bounds age at sample time, NOT now.
Every requested slot is reported independently; no full-inventory claim.
Missing/stale NBT is unknown; a complete typed compound without chargedItem
is explicitly uncharged. Failures seal; create a new instance after reconnect.

CrossbowInventoryObservations.__init__ ​

python
def __init__(
    self,
    *,
    connection_id,
    connected_at,
    crossbow_slot,
    crossbow_network_id,
    ammo_network_id,
    ammo_slots,
    max_age_ms,
)

CrossbowInventoryObservations.close ​

python
def close(self)

CrossbowInventoryObservations.apply ​

python
def apply(self, snapshot)

CrossbowInventoryObservations.connection_id ​

python
self.connection_id

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

CrossbowInventoryObservations.connected_at ​

python
self.connected_at

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

CrossbowInventoryObservations.crossbow_slot ​

python
self.crossbow_slot

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

CrossbowInventoryObservations.ammo_slots ​

python
self.ammo_slots

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

CrossbowInventoryObservations.crossbow_network_id ​

python
self.crossbow_network_id

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

CrossbowInventoryObservations.ammo_network_id ​

python
self.ammo_network_id

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

CrossbowInventoryObservations.max_age_ms ​

python
self.max_age_ms

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

CrossbowInventoryObservations.valid ​

python
self.valid

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

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