Skip to content

NpcInteraction

Namespace Mc.Scripting · Kind struct (readonly)

public readonly struct NpcInteraction

A click on an NPC ({{cref:M:Mc.Scripting.Npcs.OnInteract(System.Action{Mc.Scripting.NpcInteraction})}}).

Member Description
NpcClick Action { get; } A left click (an attack) or a right click (an interaction).
Hand Hand { get; } The hand of the click (a left click is the main hand).
ulong Handle { get; } The handle of the NPC (the engine’s; NpcInteraction.Npc of it is NpcInteraction.Npc.Handle).
Npc? Npc { get; } The NPC, if it still exists.
Player Player { get; } The player who clicked.
bool Sneaking { get; } Whether the player was sneaking.
public NpcClick Action { get; }

A left click (an attack) or a right click (an interaction).

public Hand Hand { get; }

The hand of the click (a left click is the main hand).

public ulong Handle { get; }

The handle of the NPC (the engine’s; NpcInteraction.Npc of it is NpcInteraction.Npc.Handle).

public Npc? Npc { get; }

The NPC, if it still exists.

public Player Player { get; }

The player who clicked.

public bool Sneaking { get; }

Whether the player was sneaking.

Hand · Npc · NpcClick · Player