# ContainerUpdate

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

**Cancellable:** No. Calling `event.cancel()` throws `UnsupportedOperationException`.

Fires after the client handles a full container-content packet. For individual slot updates, see
[EventSlotUpdate](EventSlotUpdate.md). For screen
openings, see [EventOpenContainer](EventOpenContainer.md).  
A packet for the player's inventory supplies a newly created inventory screen as [screen](#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_screen),  
which may not be the screen currently displayed.

## Constructors

### new EventContainerUpdate {#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_constructor-AbstractContainerScreen-}

```js
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](../../../../../../../../../classes/com/jsmacrosce/jsmacros/client/api/classes/render/IScreen.md); otherwise the cast fails after the inventory wrapper is created.

**Parameters:**
- `screen`: the container screen to wrap and retain as [screen](#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_screen); may be null

## Fields

### inventory {#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_inventory}

```js
inventory: Inventory<?>
```

The container represented by the associated screen, wrapped in a new [Inventory](../../../../../../../../../classes/com/jsmacrosce/jsmacros/client/api/classes/inventory/Inventory.md).

### screen {#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_screen}

```js
screen: IScreen
```

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 {#com.jsmacrosce.jsmacros.client.api.event.impl.inventory.EventContainerUpdate_toString-}

```js
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}`
