> For the complete documentation index, see [llms.txt](https://scripting.breeze.rip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripting.breeze.rip/newgen/api/net/minecraft/client/multiplayer/multiplayergamemode.md).

# MultiPlayerGameMode

Performs actions the way vanilla does: attacking, using items, clicking slots.

### Properties

#### destroyProgress

> `readonly` **destroyProgress**: `number`

How far the current block is mined, from 0 to 1.

***

#### destroyStage

> `readonly` **destroyStage**: `number`

The crack stage shown on the block being mined, 0 to 9, or -1 when none.

***

#### isDestroying

> `readonly` **isDestroying**: `boolean`

Whether a block is being mined.

***

#### playerMode

> `readonly` **playerMode**: [`GameType`](/newgen/api/enum_types/gametype.md)

The game mode of the local player.

### Methods

#### attack()

> **attack**(`target`): `void`

Attacks an entity and swings, like a left click.

**Parameters**

**target**

[`Entity`](/newgen/api/net/minecraft/world/entity/entity.md)

The entity to attack.

**Returns**

`void`

***

#### clickContainerSlot()

> **clickContainerSlot**(`containerId`, `slot`, `button`, `input`): `void`

Clicks a slot of a specific container.

**Parameters**

**containerId**

`number`

The container id of the open menu.

**slot**

`number`

The slot index in the container.

**button**

`number`

The mouse button, or the hotbar slot for SWAP.

**input**

[`ContainerInput`](/newgen/api/enum_types/containerinput.md)

How the slot is clicked.

**Returns**

`void`

**Remarks**

Does nothing when the container id is not the open menu's. Sends a click packet.

***

#### clickSlot()

> **clickSlot**(`slot`, `button`, `input`): `void`

Clicks a slot of the open container (the inventory when none is open).

**Parameters**

**slot**

`number`

The slot index in the container.

**button**

`number`

The mouse button, or the hotbar slot for SWAP.

**input**

[`ContainerInput`](/newgen/api/enum_types/containerinput.md)

How the slot is clicked.

**Returns**

`void`

***

#### continueDestroyBlock()

> **continueDestroyBlock**(`pos`, `direction`): `boolean`

Keeps mining a block, once per tick. True while mining.

**Parameters**

**pos**

[`BlockPos`](/newgen/api/net/minecraft/core/blockpos.md)

The block.

**direction**

[`Direction`](/newgen/api/enum_types/direction.md)

The face being mined.

**Returns**

`boolean`

***

#### hasInfiniteItems()

> **hasInfiniteItems**(): `boolean`

Whether the local player has unlimited materials, as in creative mode.

**Returns**

`boolean`

***

#### interact()

> **interact**(`target`, `hand`): `boolean`

Uses an item or hand on an entity, like a right click on it. True if something happened.

**Parameters**

**target**

[`Entity`](/newgen/api/net/minecraft/world/entity/entity.md)

The entity.

**hand**

[`InteractionHand`](/newgen/api/enum_types/interactionhand.md)

The hand to use.

**Returns**

`boolean`

**Remarks**

Sends an interact packet that aims at the centre of the entity.

***

#### pickup()

> **pickup**(`slot`, `button`): `void`

Picks up, places or swaps the stack in a slot with the cursor, like a click.

**Parameters**

**slot**

`number`

The slot index in the open container.

**button**

`number`

0 for left click, 1 for right click.

**Returns**

`void`

**Remarks**

Sends a click packet.

***

#### quickMove()

> **quickMove**(`slot`): `void`

Moves a stack to the other part of the container, like a shift click.

**Parameters**

**slot**

`number`

The slot index in the open container.

**Returns**

`void`

**Remarks**

Sends a click packet.

***

#### releaseUsingItem()

> **releaseUsingItem**(): `void`

Stops using the held item, e.g. to shoot a drawn bow.

**Returns**

`void`

***

#### startDestroyBlock()

> **startDestroyBlock**(`pos`, `direction`): `boolean`

Starts mining a block. True if it started.

**Parameters**

**pos**

[`BlockPos`](/newgen/api/net/minecraft/core/blockpos.md)

The block.

**direction**

[`Direction`](/newgen/api/enum_types/direction.md)

The face being mined.

**Returns**

`boolean`

***

#### stopDestroyBlock()

> **stopDestroyBlock**(): `void`

Stops mining.

**Returns**

`void`

***

#### swap()

> **swap**(`slot`, `hotbarSlot`): `void`

Swaps a slot with a hotbar slot, like pressing a number key over it.

**Parameters**

**slot**

`number`

The slot index in the open container.

**hotbarSlot**

`number`

The hotbar slot, 0 to 8, or 40 for the offhand.

**Returns**

`void`

**Remarks**

Sends a click packet.

***

#### syncSelectedSlot()

> **syncSelectedSlot**(): `void`

Tells the server which hotbar slot is selected, if it was not told yet.

**Returns**

`void`

**Remarks**

Sends a carried-item packet only when the selection changed since the last one.

***

#### throwItem()

> **throwItem**(`slot`, `all`): `void`

Drops the stack in a slot, like pressing the drop key over it.

**Parameters**

**slot**

`number`

The slot index in the open container.

**all**

`boolean`

Whether to drop the whole stack instead of one item.

**Returns**

`void`

**Remarks**

Sends a click packet.

***

#### useItem()

> **useItem**(`hand`): `boolean`

Uses the held item, like a right click in the air. True if something happened.

**Parameters**

**hand**

[`InteractionHand`](/newgen/api/enum_types/interactionhand.md)

The hand to use.

**Returns**

`boolean`

***

#### useItemOn()

> **useItemOn**(`hand`, `hit`): `boolean`

Uses the held item on a block face, like a right click on it. True if something happened.

**Parameters**

**hand**

[`InteractionHand`](/newgen/api/enum_types/interactionhand.md)

The hand to use.

**hit**

[`BlockHitResult`](/newgen/api/net/minecraft/world/phys/blockhitresult.md)

The block face to use it on.

**Returns**

`boolean`
