# InteractionManagerHelper

`com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper`

**Since:** 1.9.0

Controls client-side player interactions with the world through the current interaction manager.  
 
 Obtain it with `Player.interactions()`, which is `null` when no interaction
 manager is available. Block and entity target overrides affect operations that use the
 crosshair until cleared; range and block checks may also clear or turn an override into a
 miss.  
 
 An `await` option waits for the queued client-thread invocation when called from outside
 the client thread and its joined-thread stack; it does not wait for server confirmation.  
 Calls on that stack execute directly. [breakBlock()](#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_breakBlock-) rejects waiting on that stack
 after checking for an immediate result; timed [holdInteract(int)](#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_holdInteract-int-) calls reject it
 before enabling the hold. Waiting can be interrupted; interruption during a timed hold
 can leave the interact override enabled.  
 ```js
const interactions = Player.interactions();  
if (interactions === null) { throw new Error("not in a world"); }

interactions.breakBlockAsync(JavaWrapper.methodToJava(function (result) {
  Chat.log(`break finished as ${result.reason}`);  
}));  
 ```

## Constructors

### new InteractionManagerHelper {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_constructor-MultiPlayerGameMode-}

```js
new InteractionManagerHelper(MultiPlayerGameMode base)
```

Wraps the supplied interaction manager as this helper's initial reference.

**Parameters:**
- `base`: initial interaction manager to wrap

## Fields

### autoUpdateBase {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_autoUpdateBase}

```js
autoUpdateBase: boolean
```

Whether methods refresh this helper's wrapped manager when it differs from the client's
 current manager. Defaults to `true`; when disabled, a mismatch throws
 [RuntimeException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/RuntimeException.html). If no replacement manager exists, updating fails and retains
 the wrapped manager. See [checkBase(boolean)](#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_checkBase-boolean-) for the exact result.

## Methods

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-}

```js
attack(): InteractionManagerHelper
```

**Returns:** self for chaining

**Since:** 1.5.0

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-boolean-}

```js
attack(boolean await): InteractionManagerHelper
```

**Parameters:**
- `await`: whether to wait for the queued client-thread attack call to finish when called outside the client thread and its joined-thread stack; calls on that stack execute directly. This does not wait for server confirmation

**Returns:** self for chaining

**Since:** 1.6.0

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-EntityHelper-}

```js
attack(EntityHelper<?> entity): InteractionManagerHelper
```

Attacks the entity and swings the main-hand item. Does nothing if the interaction manager is unavailable.

**Parameters:**
- `entity`: entity to attack; targeting the local player throws `AssertionError`

**Returns:** self for chaining

**Since:** 1.5.0

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-EntityHelper-boolean-}

```js
attack(EntityHelper<?> entity, boolean await): InteractionManagerHelper
```

Attacks the entity and swings the main-hand item. Does nothing if the interaction manager is unavailable.

**Parameters:**
- `entity`: entity to attack; targeting the local player throws `AssertionError`
- `await`: whether to wait for the queued attack and swing to finish when called outside the client thread and its joined-thread stack; calls on that stack execute directly. This does not wait for server confirmation

**Returns:** self for chaining

**Since:** 1.6.0

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-int-int-int-String-}

```js
attack(int x, int y, int z, String direction): InteractionManagerHelper
```

Starts breaking the block at the given block coordinates and swings the main-hand item.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: block face name: `up`, `down`, `north`, `south`, `east`, or `west`

**Returns:** self for chaining.

**Since:** 1.8.4

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-int-int-int-int-}

```js
attack(int x, int y, int z, int direction): InteractionManagerHelper
```

Starts breaking the block at the given block coordinates and swings the main-hand item.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face's 3D data value (0-5: down, up, north, south, west, east)

**Returns:** self for chaining

**Since:** 1.5.0

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-int-int-int-String-boolean-}

```js
attack(int x, int y, int z, String direction, boolean await): InteractionManagerHelper
```

Starts breaking the block at the given block coordinates and swings the main-hand item.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: block face name: `up`, `down`, `north`, `south`, `east`, or `west`
- `await`: whether to wait for the queued block-breaking call and swing to finish when called outside the client thread and its joined-thread stack; calls on that stack execute directly. This does not wait for server confirmation

**Returns:** self for chaining.

**Since:** 1.8.4

### attack {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_attack-int-int-int-int-boolean-}

```js
attack(int x, int y, int z, int direction, boolean await): InteractionManagerHelper
```

Starts breaking the block at the given block coordinates and swings the main-hand item.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face's 3D data value (0-5: down, up, north, south, west, east)
- `await`: whether to wait for the queued block-breaking call and swing to finish when called outside the client thread and its joined-thread stack; calls on that stack execute directly. This does not wait for server confirmation

**Returns:** self for chaining

**Since:** 1.6.0

### breakBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_breakBlock-}

```js
breakBlock(): InteractionProxy.Break.BreakBlockResult
```

Breaks the currently targeted block and waits for the break result.  
 An immediate result is checked first; otherwise, calling on the client thread or a thread
 joined to it throws [IllegalThreadStateException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalThreadStateException.html). No targeted block is reported by
 a callback outcome such as `NO_TARGET`, not by returning `null`.

**Returns:** the reported break result, or `UNAVAILABLE` when the immediate check finds no interaction manager

**Since:** 1.9.0

### breakBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_breakBlock-int-int-int-}

```js
breakBlock(int x, int y, int z): InteractionProxy.Break.BreakBlockResult
```

Attempts to break the block at the given position, temporarily overriding the target when needed.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate

**Returns:** the break result, or `null` if the position cannot be targeted

**Since:** 1.9.0

### breakBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_breakBlock-BlockPosHelper-}

```js
breakBlock(BlockPosHelper pos): InteractionProxy.Break.BreakBlockResult
```

Attempts to break the block at `pos`, temporarily overriding the target when needed.

**Parameters:**
- `pos`: position to break

**Returns:** the break result, or `null` if the position cannot be targeted

**Since:** 1.9.0

### breakBlockAsync {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_breakBlockAsync-MethodWrapper-}

```js
breakBlockAsync(MethodWrapper<InteractionProxy.Break.BreakBlockResult, Object, ?, ?> callback): InteractionManagerHelper
```

Starts breaking the currently targeted block and delivers the outcome to `callback`.  
 A null callback starts the break without registering for its outcome. `SUCCESS`
 means the client completed the break; it does not guarantee server acceptance.  
 Immediate-result callbacks are submitted to the client thread, and normal game-driven
 completion runs there. Cancellation, target clearing, reset, or a break-override query can
 instead invoke pending callbacks synchronously on the calling thread.  
 ```js
const interactions = Player.interactions();  
if (interactions === null) { throw new Error("not in a world"); }

// start it and carry on, with the outcome arriving later
interactions.breakBlockAsync(JavaWrapper.methodToJava(function (result) {
  if (result !== null) {
    Chat.log(`break finished as ${result.reason}`);  
  }
}));  

 ```

**Parameters:**
- `callback`: receives the break outcome

**Returns:** self for chaining

**Since:** 1.9.0

### cancelBreakBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_cancelBreakBlock-}

```js
cancelBreakBlock(): InteractionManagerHelper
```

Cancels the active block-break override and reports `CANCELLED` to registered callbacks.  
 Callbacks run synchronously on the caller's thread.

**Returns:** self for chaining

**Since:** 1.9.0

### checkBase {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_checkBase-boolean-}

```js
checkBase(boolean update): boolean
```

Checks whether the wrapped manager is current, optionally replacing it with the client's current manager.  
 Matching references return `true`, including when both are `null`.  
 A mismatch with `update == false` throws [RuntimeException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/RuntimeException.html).

**Parameters:**
- `update`: whether to replace a stale manager with a non-null current manager

**Returns:** `true` if the references match or replacement succeeds; `false` if
         replacement was requested but the current manager is null, leaving the wrapped manager unchanged

### clearTargetOverride {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_clearTargetOverride-}

```js
clearTargetOverride(): InteractionManagerHelper
```

Clears the crosshair target override.  
 Revalidating the pending break override can end it and invoke its callbacks on the caller's thread.

**Returns:** self for chaining

**Since:** 1.9.0

### getGameMode {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_getGameMode-}

```js
getGameMode(): String
```

**Returns:** the wrapped manager's current game mode

**Since:** 1.9.0

### getTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_getTarget-}

```js
getTarget(): HitResultHelper<?>
```

**Returns:** the current crosshair hit result, or `null` if none is available

**Since:** 1.9.1

### getTargetedBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_getTargetedBlock-}

```js
getTargetedBlock(): BlockPosHelper
```

**Returns:** the targeted block position, or `null` when the current hit result is not a block hit

**Since:** 1.9.0

### getTargetedEntity {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_getTargetedEntity-}

```js
getTargetedEntity(): EntityHelper<?>
```

**Returns:** the entity currently under the crosshair, or `null` when there is no crosshair entity

**Since:** 1.9.0

### hasBreakBlockOverride {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_hasBreakBlockOverride-}

```js
hasBreakBlockOverride(): boolean
```

Checks whether a break override is active. This can terminate an invalid override and
 dispatch pending callbacks synchronously on the caller's thread.

**Returns:** `true` while a valid break override remains active

**Since:** 1.9.0

### hasInteractOverride {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_hasInteractOverride-}

```js
hasInteractOverride(): boolean
```

**Returns:** whether the hold-interact override is active

**Since:** 1.9.0

### hasTargetOverride {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_hasTargetOverride-}

```js
hasTargetOverride(): boolean
```

**Returns:** whether a crosshair target override is set, including a miss override

**Since:** 1.9.0

### holdInteract {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_holdInteract-boolean-}

```js
holdInteract(boolean holding): InteractionManagerHelper
```

Starts or stops the continuous interact override.

**Parameters:**
- `holding`: whether to enable or disable the override

**Returns:** this helper for chaining

**Since:** 1.9.0

### holdInteract {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_holdInteract-boolean-boolean-}

```js
holdInteract(boolean holding, boolean awaitFirstClick): InteractionManagerHelper
```

Starts or stops the continuous interact override.  
 Disabling runs directly on the caller's thread. Enabling runs directly on the client or
 joined-thread stack, otherwise it is queued on the client thread.

**Parameters:**
- `holding`: whether to enable or disable the override
- `awaitFirstClick`: whether to wait for queued enabling work, not server confirmation; ignored when disabling

**Returns:** this helper for chaining

**Since:** 1.9.0

### holdInteract {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_holdInteract-int-}

```js
holdInteract(int ticks): int
```

Holds interact for up to the specified number of unpaused game ticks, stopping when paused
 or when the override stops. Calling on the client or joined-thread stack throws
 [IllegalThreadStateException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalThreadStateException.html). The hold is released on normal return; interruption
 while waiting can leave it active.

**Parameters:**
- `ticks`: number of ticks to hold

**Returns:** ticks not yet elapsed; nonzero if the hold was stopped by pausing with `stopOnPause` enabled or if the override stopped, and `0` when the full duration elapsed

**Since:** 1.9.0

### holdInteract {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_holdInteract-int-boolean-}

```js
holdInteract(int ticks, boolean stopOnPause): int
```

Holds interact for up to the specified number of unpaused game ticks. Calling on the client
 or joined-thread stack throws [IllegalThreadStateException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalThreadStateException.html). The hold is released on
 normal return; interruption while waiting can leave it active.

**Parameters:**
- `ticks`: number of unpaused ticks to hold
- `stopOnPause`: whether to stop when the game is paused; if `false`, paused ticks do not count and the hold resumes after unpausing

**Returns:** ticks remaining; nonzero if paused with `stopOnPause` enabled or if the override stopped, and `0` when the full duration elapsed

**Since:** 1.9.0

### interact {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interact-}

```js
interact(): InteractionManagerHelper
```

Starts using the main-hand item.

**Returns:** self for chaining

**Since:** 1.5.0

### interact {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interact-boolean-}

```js
interact(boolean await): InteractionManagerHelper
```

**Parameters:**
- `await`: whether to wait for the queued client-thread invocation; calls on the client or
              joined-thread stack execute directly, and no server confirmation is awaited

**Returns:** self for chaining

**Since:** 1.6.0

### interactBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactBlock-int-int-int-String-boolean-}

```js
interactBlock(int x, int y, int z, String direction, boolean offHand): InteractionManagerHelper
```

Interacts with the block at the given coordinates, using the face named by `direction`.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face name: `up`, `down`, `north`, `south`, `east`, or `west`
- `offHand`: whether to use the off hand instead of the main hand

**Returns:** this helper for chaining

**Since:** 1.8.4

### interactBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactBlock-int-int-int-int-boolean-}

```js
interactBlock(int x, int y, int z, int direction, boolean offHand): InteractionManagerHelper
```

Interacts with the block at the given coordinates, using the face selected by its 3D data value.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face data value: `0` down, `1` up, `2` north, `3` south, `4` west, `5` east
- `offHand`: whether to use the off hand instead of the main hand

**Returns:** self for chaining

**Since:** 1.5.0

**Note:** renamed from `interact` in 1.6.0

### interactBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactBlock-int-int-int-String-boolean-boolean-}

```js
interactBlock(int x, int y, int z, String direction, boolean offHand, boolean await): InteractionManagerHelper
```

Interacts with the block at the given coordinates, using the face named by `direction`.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face name: `up`, `down`, `north`, `south`, `east`, or `west`
- `offHand`: whether to use the off hand instead of the main hand
- `await`: whether to wait for the queued client-thread task to run; it does not wait for server confirmation

**Returns:** this helper for chaining

**Since:** 1.8.4

### interactBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactBlock-int-int-int-int-boolean-boolean-}

```js
interactBlock(int x, int y, int z, int direction, boolean offHand, boolean await): InteractionManagerHelper
```

Interacts with the block at the given coordinates, using the face selected by its 3D data value.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face data value: `0` down, `1` up, `2` north, `3` south, `4` west, `5` east
- `offHand`: whether to use the off hand instead of the main hand
- `await`: whether to wait for the queued client-thread task to run; it does not wait for server confirmation

**Returns:** this helper for chaining

**Since:** 1.5.0

**Note:** renamed from `interact` in 1.6.0

### interactEntity {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactEntity-EntityHelper-boolean-}

```js
interactEntity(EntityHelper<?> entity, boolean offHand): InteractionManagerHelper
```

Interacts with `entity` using the selected hand.

**Parameters:**
- `entity`: entity to interact with; the local player's entity causes `AssertionError`
- `offHand`: whether to use the off hand instead of the main hand

**Returns:** self for chaining

**Since:** 1.5.0

**Note:** renamed from `interact` in 1.6.0

### interactEntity {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactEntity-EntityHelper-boolean-boolean-}

```js
interactEntity(EntityHelper<?> entity, boolean offHand, boolean await): InteractionManagerHelper
```

Interacts with an entity using the selected hand.

**Parameters:**
- `entity`: entity to interact with; the player's own entity causes an [AssertionError](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/AssertionError.html)
- `offHand`: whether to use the off hand instead of the main hand
- `await`: whether to wait for the queued client-thread task to run; it does not wait for server confirmation

**Returns:** self for chaining

**Since:** 1.6.0

### interactItem {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactItem-boolean-}

```js
interactItem(boolean offHand): InteractionManagerHelper
```

Uses the selected hand's held item.

**Parameters:**
- `offHand`: whether to use the off hand instead of the main hand

**Returns:** self for chaining

**Since:** 1.5.0

**Note:** renamed from `interact` in 1.6.0

### interactItem {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_interactItem-boolean-boolean-}

```js
interactItem(boolean offHand, boolean await): InteractionManagerHelper
```

Uses the selected hand's held item.

**Parameters:**
- `offHand`: whether to use the off hand instead of the main hand
- `await`: whether to wait for the queued client-thread task to run; it does not wait for server confirmation

**Returns:** self for chaining

**Since:** 1.6.0

### isBreakingBlock {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_isBreakingBlock-}

```js
isBreakingBlock(): boolean
```

**Returns:** whether the current interaction manager is destroying a block

**Since:** 1.8.0

### resetTargetChecks {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_resetTargetChecks-}

```js
resetTargetChecks(): InteractionManagerHelper
```

Resets the checks to defaults: range checking enabled and clears out-of-range targets;  
 air checking disabled and retains air targets; shape checking enabled and turns empty
 shapes into misses.

**Returns:** self for chaining

**Since:** 1.9.0

### setGameMode {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setGameMode-String-}

```js
setGameMode(String gameMode): InteractionManagerHelper
```

Sets the client's local game mode; it does not change the server's game mode.

**Parameters:**
- `gameMode`: game mode name; recognized names are case-insensitive, and unrecognized names retain the current mode

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-int-int-int-}

```js
setTarget(int x, int y, int z): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at these coordinates and its down face.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-int-int-int-String-}

```js
setTarget(int x, int y, int z, String direction): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at these coordinates and the named face.  
 
 This is an override, not a read: it tells the game that the calls acting on "whatever the
 player is looking at" should act on this block instead. It stays in place until
 [clearTargetOverride()](#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_clearTargetOverride-) puts it back, so a script that sets one and does not clear
 it has changed the game for everything that runs after it.  
 

 The override remains until cleared or removed by configured target checks. The other overloads
 accept a [BlockPosHelper](world/BlockPosHelper.md), a 3D face data value, or an entity.  
 ```js
const interactions = Player.interactions();  
if (interactions === null) { throw new Error("not in a world"); }

// act on the top face of a specific block, then put the crosshair back
interactions.setTarget(10, 64, -10, "up");  
interactions.interactBlock(10, 64, -10, "up", false);  
interactions.clearTargetOverride();  
 ```

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: block face name: `up`, `down`, `north`, `south`, `east`, or `west`

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-int-int-int-int-}

```js
setTarget(int x, int y, int z, int direction): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at these coordinates and the face identified by its 3D data value.

**Parameters:**
- `x`: block x coordinate
- `y`: block y coordinate
- `z`: block z coordinate
- `direction`: face's 3D data value (0-5: down, up, north, south, west, east)

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-BlockPosHelper-}

```js
setTarget(BlockPosHelper pos): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at `pos` and its down face.

**Parameters:**
- `pos`: block position

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-BlockPosHelper-String-}

```js
setTarget(BlockPosHelper pos, String direction): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at `pos` and the named face.

**Parameters:**
- `pos`: block position
- `direction`: block face name: `up`, `down`, `north`, `south`, `east`, or `west`

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-BlockPosHelper-int-}

```js
setTarget(BlockPosHelper pos, int direction): InteractionManagerHelper
```

Overrides the crosshair hit result with the block at `pos` and the face identified by its 3D data value.

**Parameters:**
- `pos`: block position
- `direction`: face's 3D data value (0-5: down, up, north, south, west, east)

**Returns:** self for chaining

**Since:** 1.9.0

### setTarget {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTarget-EntityHelper-}

```js
setTarget(EntityHelper<?> entity): InteractionManagerHelper
```

Overrides the crosshair hit result with the entity. Throws an `AssertionError` if the entity is not pickable or is the local player.

**Parameters:**
- `entity`: entity to target

**Returns:** self for chaining

**Since:** 1.9.0

### setTargetAirCheck {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTargetAirCheck-boolean-boolean-}

```js
setTargetAirCheck(boolean enabled, boolean autoClear): InteractionManagerHelper
```

**Parameters:**
- `enabled`: whether to check if a block target is air; defaults to `false`
- `autoClear`: whether an air-block override is cleared; if `false`, it becomes a miss

**Returns:** self for chaining

**Since:** 1.9.0

### setTargetMissed {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTargetMissed-}

```js
setTargetMissed(): InteractionManagerHelper
```

Overrides the crosshair hit result with a miss.

**Returns:** self for chaining

**Since:** 1.9.0

### setTargetRangeCheck {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTargetRangeCheck-boolean-boolean-}

```js
setTargetRangeCheck(boolean enabled, boolean autoClear): InteractionManagerHelper
```

**Parameters:**
- `enabled`: whether to check override range; defaults to `true`
- `autoClear`: whether an out-of-range override is cleared; if `false`, it becomes a miss

**Returns:** self for chaining

**Since:** 1.9.0

### setTargetShapeCheck {#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTargetShapeCheck-boolean-boolean-}

```js
setTargetShapeCheck(boolean enabled, boolean autoClear): InteractionManagerHelper
```

Controls whether block-target overrides are rejected when the block's collision shape is empty.  
 Air blocks are excluded from this check; use [setTargetAirCheck(boolean, boolean)](#com.jsmacrosce.jsmacros.client.api.helper.InteractionManagerHelper_setTargetAirCheck-boolean-boolean-) to check air.

**Parameters:**
- `enabled`: whether to check for an empty block shape; defaults to `true`
- `autoClear`: whether an override with an empty shape is cleared; otherwise it becomes a miss. Defaults to `false`

**Returns:** self for chaining

**Since:** 1.9.0
