detect npc location

Discuss any issues with Denizen-Bukkit scripts or functionality you may have while using it.
Post Reply
User avatar
hmmcrunchy
New
New
Posts: 7
Joined: November 2nd, 2016, 12:50 am
Location: UK
Contact:

detect npc location

Post by hmmcrunchy » November 18th, 2016, 5:52 am

Is it possible to check during chat with an NPC if the NPC is within a certain distance of a point.

If they are you can zap to a subroutine if not they zap to another routine
Image
[url]http://www.byte.org.uk[/url]

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 201
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: detect npc location

Post by mcmonkey » November 18th, 2016, 6:16 am

(Topic moved to correct location)

- if <npc.location.distance[<npc.anchor[farPoint]>]> < 10 { will pass if the NPC is within 10 blocks of 'farPoint' anchor. Swap variables and tags freely to whatever you need. The location.distance[...] bit is the key.
Denizen lead developer.
http://mcmonkey.org

User avatar
hmmcrunchy
New
New
Posts: 7
Joined: November 2nd, 2016, 12:50 am
Location: UK
Contact:

Re: detect npc location

Post by hmmcrunchy » November 18th, 2016, 6:53 am

(thanks)

fantastic once again thank you.

if you are interested I'm doing characters that say different things if at home to at their shops
Image
[url]http://www.byte.org.uk[/url]

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest