Skip to main content

~onInteract

Fires when a player right-clicks on the entity. Useful for NPCs, quest mobs, and interactive creatures.

Parameters

ParameterDefaultDescription
oncefalseOnly trigger once per entity lifetime
cooldown0Minimum ticks between triggers (prevents spam)

Context Variables

  • @TriggerSource - The player who interacted

Examples

Skills:
- animation{name=wave} ~onInteract
- animation{name=talk} ~onInteract{cooldown=40}

Common Patterns

NPC Greeting

Skills:
- animation{name=wave} ~onInteract{cooldown=60}

Quest Giver

Skills:
- animation{name=talk} ~onInteract{cooldown=20}
- showbone{bone=quest_marker} ~onInteract{once=true}

Merchant Animation

Skills:
- animation{name=show_wares} ~onInteract{cooldown=40}

One-Time Interaction

Skills:
- animation{name=awaken} ~onInteract{once=true}
- showbone{bone=eyes} ~onInteract{once=true}

Scared Creature

Skills:
- animation{name=flinch} ~onInteract
- hidebone{bone=happy_face} ~onInteract
- showbone{bone=scared_face} ~onInteract

Notes

  • Only main hand (right-click) interactions trigger this
  • Interaction skills fire before taming logic if taming is enabled
  • Use cooldown to prevent animation spam from rapid clicking