<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [BlockType](./server.blocktype.md) &gt; [interact](./server.blocktype.interact.md)

## BlockType.interact() method

Triggers an interaction on the block type from a player.

Use for: programmatic interactions that should mimic player clicks.

**Signature:**

```typescript
interact(player: Player, raycastHit?: RaycastHit): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

player


</td><td>

[Player](./server.player.md)


</td><td>

The player interacting with the block type.


</td></tr>
<tr><td>

raycastHit


</td><td>

[RaycastHit](./server.raycasthit.md)


</td><td>

_(Optional)_ The raycast hit result, if the interaction was triggered by a client-side click/tap.

\*\*Side effects:\*\* Emits `BlockTypeEvent.INTERACT`<!-- -->.

\*\*Category:\*\* Blocks


</td></tr>
</tbody></table>
**Returns:**

void

## Remarks

This is automatically called when a player clicks or taps a block of this block type, but can also be called directly for programmatic interactions. Emits `BlockTypeEvent.INTERACT`<!-- -->.

