Skip to content

ContainerUpdate ​

com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate

Not cancellable

Fires after the client handles a full container-content packet. For individual slot updates, see EventSlotUpdate. For screen openings, see EventOpenContainer.
A packet for the player's inventory supplies a newly created inventory screen as screen,
which may not be the screen currently displayed.

Constructors ​

new EventContainerUpdate ​

new EventContainerUpdate(AbstractContainerScreen<?> screen)#
Wraps the supplied container screen as the event's screen and inventory. A null screen produces null values for both fields. A non-null screen must implement IScreen; otherwise the cast fails after the inventory wrapper is created.

Parameters:

  • screen: the container screen to wrap and retain as screen; may be null

Fields ​

inventory ​

inventory: Inventory<?>read-only#
The container represented by the associated screen, wrapped in a new Inventory.

screen ​

screen: IScreenread-only#
The screen associated with the resynced container. For a player-inventory packet this is a newly created inventory screen, not necessarily the screen currently displayed.

Methods ​

toString ​

toString(): String#
Returns a diagnostic string containing the event name, current screen name, and inventory. A null screen name is rendered as the quoted string "null"; a null inventory is rendered as the unquoted token null. This is a formatted diagnostic, not a JSON serialization of the screen or container.
Returns: a brace-delimited diagnostic of the form eventName:{"screenName": "name", "inventory": value}