# PlayerControllerMP

Can be used for controlling the local player.

### Methods

#### attackEntity()

> **attackEntity**(`entity`): `void`

Attack an entity with the current item.

**Parameters**

**entity**

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

The target entity.

**Returns**

`void`

***

#### clickBlock()

> **clickBlock**(`pos`, `facing`): `boolean`

Start breaking a block.

**Parameters**

**pos**

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

The block position

**facing**

[`EnumFacing`](/api/enum_types/enumfacing.md)

The face being hit (e.g. NORTH, SOUTH, UP, DOWN, EAST, WEST)

**Returns**

`boolean`

***

#### damageBlock()

> **damageBlock**(`pos`, `facing`): `boolean`

Continue damaging a block (hold action).

**Parameters**

**pos**

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

The position of the block.

**facing**

[`EnumFacing`](/api/enum_types/enumfacing.md)

The direction you are interacting with.

**Returns**

`boolean`

True if action handled and we actually continue breaking the block.

***

#### destroyBlock()

> **destroyBlock**(`pos`, `facing`): `boolean`

Immediately destroy a block if allowed.

**Parameters**

**pos**

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

The position of the block.

**facing**

[`EnumFacing`](/api/enum_types/enumfacing.md)

The direction you are interacting with.

**Returns**

`boolean`

***

#### extendedReach()

> **extendedReach**(): `boolean`

**Returns**

`boolean`

True if extended reach is enabled (Creative).

***

#### flipPlayer()

> **flipPlayer**(`player`): `void`

Flip the player's yaw 180°.

**Parameters**

**player**

[`EntityPlayer`](/api/net/minecraft/client/entity/entityplayer.md)

The player to flip.

**Returns**

`void`

***

#### gameIsSurvivalOrAdventure()

> **gameIsSurvivalOrAdventure**(): `boolean`

**Returns**

`boolean`

True if in Survival or Adventure.

***

#### getBlockReachDistance()

> **getBlockReachDistance**(): `number`

**Returns**

`number`

Reach distance in blocks.

***

#### getCurrentGameType()

> **getCurrentGameType**(): `number`

**Returns**

`number`

Current game type ID (0=Survival,1=Creative,2=Adventure,3=Spectator).

***

#### interactWithEntity()

> **interactWithEntity**(`entity`): `boolean`

Interact with an entity (right-click).

**Parameters**

**entity**

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

The target entity.

**Returns**

`boolean`

True if handled.

***

#### isHittingBlock()

> **isHittingBlock**(): `boolean`

**Returns**

`boolean`

True if currently breaking a block.

***

#### isInCreativeMode()

> **isInCreativeMode**(): `boolean`

**Returns**

`boolean`

True if in Creative.

***

#### isNotCreative()

> **isNotCreative**(): `boolean`

**Returns**

`boolean`

True if not in Creative.

***

#### isRidingHorse()

> **isRidingHorse**(): `boolean`

**Returns**

`boolean`

True if the local player is riding a horse.

***

#### isSpectator()

> **isSpectator**(): `boolean`

**Returns**

`boolean`

If the player is a spectator.

***

#### isSpectatorMode()

> **isSpectatorMode**(): `boolean`

**Returns**

`boolean`

True if in Spectator mode.

***

#### resetBlockRemoving()

> **resetBlockRemoving**(): `void`

Abort current block breaking progress.

**Returns**

`void`

***

#### rightClickBlock()

> **rightClickBlock**(`pos`, `facing`, `hitVec`): `boolean`

Right-click a block with the currently held item.

**Parameters**

**pos**

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

The position of the block.

**facing**

[`EnumFacing`](/api/enum_types/enumfacing.md)

The direction you are interacting with.

**hitVec**

[`Vec3`](/api/net/minecraft/util/vec3.md)

The vector point you are hitting the block at.

**Returns**

`boolean`

True if action handled.

***

#### setGameType()

> **setGameType**(`gameType`): `void`

Set the game type: 0 -> survival 1 -> creative 2 -> adventure 3 -> spectator

**Parameters**

**gameType**

`number`

**Returns**

`void`

***

#### shouldDrawHUD()

> **shouldDrawHUD**(): `boolean`

**Returns**

`boolean`

True if the HUD should be drawn for the current game mode.

***

#### stopUsingItem()

> **stopUsingItem**(): `void`

Release right-click usage (bows, food, etc.).

**Returns**

`void`

***

#### syncHotbar()

> **syncHotbar**(): `void`

Sync the selected hotbar slot to the server.

**Returns**

`void`

***

#### updateController()

> **updateController**(): `void`

Process incoming packets and keep controller in sync.

**Returns**

`void`

***

#### useItemInHand()

> **useItemInHand**(): `boolean`

Use the currently held item (right-click in air).

**Returns**

`boolean`

True if the stack changed.

***

#### windowClick()

> **windowClick**(`windowId`, `slot`, `button`, `mode`): `object`

Perform an inventory click (client-side send + local container logic).

Parameters:

* windowId: The container window ID (0 = player inventory, other IDs for open GUIs).
* slot: Slot index to click. Use -999 to click outside (cursor drop).
* button: Mouse button / index depending on mode.
* mode: Integer 0..6: 0=PICKUP, 1=QUICK\_MOVE, 2=SWAP, 3=CLONE, 4=THROW, 5=QUICK\_CRAFT, 6=PICKUP\_ALL

Returns: The ItemStack on the cursor after the click (or null if empty).

**Parameters**

**windowId**

`number`

windowId

**slot**

`number`

slot

**button**

`number`

button

**mode**

`number`

mode

**Returns**

`object`

ItemStack | null


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://scripting.breeze.rip/api/net/minecraft/client/playercontrollermp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
