How can I make an NPC, let's say a region guard? In other words, he is within a delimited area in which he has an item in his hand with the skin of a Player (it will be an NPC Player) in which the NPC will interact with this item at each tick with the direction of the head towards the closest player he sees, if he does not see any player nearby he will just keep circling in that area. And for him to interact with this item, there must be no block intersecting with the NPC - player's vision and if there is a block intersecting, he moves away so he can look at the player and if he does, he starts interacting with the item. Is it possible to do this with the citizens API?
#(eusoudog7) npc goal/AI
17 messages · Page 1 of 1 (latest)
(eusoudog7) npc goal/AI
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
yes it's possible, but I am not going to code this for you
But should I use npc#addRunnable and do the pathfinding itself or does citizens already have a good API for that?
!api
+++ Info api: https://wiki.citizensnpcs.co/API
Citizens has an extensive API for working with NPCs. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.
npc.getNavigator().isNavigating() and this always returns true even though it has already reached the target
Yes, that's how it works
You can customise behaviour how you would like using the attack strategy
Thread Closing Reminder
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@warm narwhal