1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to deteсt player interaction with npc

Discussion in 'Help' started by ken4erka, Aug 5, 2021.

  1. ken4erka

    ken4erka Creeper

    Messages:
    2
    Hi. I created an NPC and would like to know how to determine that a player has clicked on an NPC? Thanks in advance.
     
  2. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Use EntityDamageByEntity event, and check if the $event->getEntity() is your NPC!
     
    Agent and Primus like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.