Sentry for Citizens2
![]() | ![]() |
|---|
Sentry is a character plugin for the NPC plugin Citizens2. With Sentry, NPC's can be set to guard areas or act as bodyguards. Hostile targeting, retaliation, and a variety of options and stats allow a Sentry NPC to be customized to almost any guarding or combat situation.
Features
Sentries Can:
- Attack monsters, players, and groups automatically. Sentry also has built-in support for Factions, Towny, War and SimpleClans
- Kill, and be killed by, players, monsters, and the environment.
- Guard locations, paths, players, or other NPCs.
- Use ranged or melee weapons. Shoot arrows, fireballs, snowballs, eggs, lightning, and potions with deadly accuracy.
- Be configured with stats such as Strength, Health, Armor, Speed, Range and even Night Vision!
- Ride mounts!
- Work with Denizen to become Bosses and Quest NPCs that run scripts upon death.
Installation
- Install Citizens2 You must use the correct version for your version of Bukkit
- Download the correct Sentry from the Citizens Wiki. You must use the correct version for your version of Bukkit
- Place Sentry.jar in your minecraft /plugins/ directory. Start your server.
- Create a NPC with Citizens and give it the 'sentry' trait.
/npc create Town Guard --trait sentry
- Customize your Sentry's stats and options and you're ready to go.
A full list of commands and options is available on the Citizens 2 Wiki
Configuration
Sentry makes a config.yml in the plugins/Sentry folder on first load. Use this to tailor Sentry to your server. You can:
- Set defaults for new sentries
- Change or disable the item used for various attack types
- Add potion effects like slow or blindness to certain Sentry weapons.
- Add armor, strength and speed buffs to armor and weapons for Sentries.
- Set critical hit chances and messages.
The config.yml is commented with instructions.
![]()


-
View User Profile
-
Send Message
Posted Jan 26, 2014@jrbudda
Ah, I understand. Just wanted to throw the idea out.
How do NPCs draw bows and shoot, though? Did you have to use any "specific" code just for sentries and bows, or did you use something generic that could potentially be applied to bows (and other weaponry) from other mods? I would fork the plugin to support certain mods, but I don't know anything about code. :(
Honestly, I just want to use this in conjunction with Flan's mod, and the weapons added by that mod are extremely simple to use - one right click, and you shoot a bullet. No drawing, no alteration in physics depending on draw power, none of those complications. Just one click, and you can shoot rounds with a constant deviation.
-
View User Profile
-
Send Message
Posted Jan 26, 2014@dinohyus
Almost certainly a version conflict between craftbukkit and Sentry.
@Xxanujenkins
NPCs have an ownership system, make sure the owner of the NPC is 'server' if you want anyone to be able to edit it.
@CommodoreAlpha
Interesting idea but I don't think NPC's can click. Clicking is something that comes in a packet from the network from real players, I don't think the server can send packets to itself. Might be a way to call the minecraft code directly but that's horribly hacky
-
View User Profile
-
Send Message
Posted Jan 25, 2014Hey, How would I set it so that when the sentry kills you the sentry will re spawns to default spawn place.
-
View User Profile
-
Send Message
Posted Jan 25, 2014Hi Jrbudda, I just sent you a message reggarding to a version issue.
Million thanks and keep with the good work!
-
View User Profile
-
Send Message
Posted Jan 24, 2014@jrbudda
(I'm just reposting this comment, because you may have missed it. If you want me to post it as a ticket, then I will.)
Weird question, but is there a way to get Sentries to work with mod-weapons without actually having to fork Sentries to accommodate those mods to begin with? Here's an even stranger idea I had that's probably not possible to do:
If a Sentry is equipped with an item not found in vanilla Minecraft, you can set them to do a "left-click action" or "right-click action" at "x" intervals for "y" amount of time per interval, with the mod-item in hand, as if they were in creative mode.
The idea is that this adds very rudimentary support for mods that, for example, would add a new bow type, or a mod like Flan's mod that adds guns.
With a new bow-type in hand, for instance, a sentry can be ordered, upon finding a target, to simply lock onto the target and "hold down" the right-click button for .7 seconds then release, and repeat this pattern every 2 seconds while locked onto the target. The reason why they should behave as if they were in creative mode is because creative mode doesn't require ammo for any mod-weapon - the only caveat is that they're invulnerable, so if you find a workaround for that, it would be great too.
-
View User Profile
-
Send Message
Posted Jan 22, 2014Having a problem with sentry's not listening to OP's. Not sure if a configuration boo boo or something to do with Citizens.
-
View User Profile
-
Send Message
Posted Jan 21, 2014For some apparent reason, there is an error that gets me frustrated. 20:31:36 [SEVERE] java.lang.NoClassDefFoundError: net/minecraft/server/v1_6_R2/Packet
Can somebody help me?!
-
View User Profile
-
Send Message
Posted Jan 20, 2014Sorry everyone for being out of touch my coding PC died. But it's back now. I'll be getting to your bug submissions shortly!
-
View User Profile
-
Send Message
Posted Jan 16, 2014I dont know why. But it seems liek "attackspeed" is not chaning the attack speed of a archer.
I build a nice castle with some archers but they are TOO good, its like cheating. I changed attackspeed to 0.5 but they shoot even faster... what i am doin wrong?
edit: kk, seems liek i need to make it higher to weak them ;-)
-
View User Profile
-
Send Message
Posted Jan 15, 2014[18:56:00 WARN]: [Sentry] Task #62 for Sentry v1.8.0 generated an exception java.lang.NullPointerException at net.aufdemrand.sentry.SentryInstance$SentryLogic.run(SentryInstance.java:1431) [?:?] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:583) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:541) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:453) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] [18:56:00 WARN]: [Sentry] Task #61 for Sentry v1.8.0 generated an exception java.lang.NullPointerException at net.aufdemrand.sentry.SentryInstance$SentryLogic.run(SentryInstance.java:1431) [?:?] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:583) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:541) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:453) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [bukkit.jar:git-Bukkit-1.6.4-R2.0-21-gcf51e92-b2938jnks] Massive spam in console also
-
View User Profile
-
Send Message
Posted Jan 14, 2014[Sentry] Task #63 for Sentry v1.8.0 generated an exception java.lang.NullPointerException
This spams the console i cant see anything!!!
-
View User Profile
-
Send Message
Posted Jan 11, 2014@xXxMC_LegendxXx
Have you isolated that issue to Sentry or Citizens? It could have to do with the intrinsic pathfinding properties of the NPCs spawned by Citizens. If this is true, Sentry can't do anything about that, as it uses the waypoint system from Citizens for the most part.
So you'd most likely have to take the complaint up with the developers at Citizens.
-
View User Profile
-
Send Message
Posted Jan 10, 2014Ok so, im having trouble with my server so when a 'sentry' fires a arrow at me i get a serious lag spike! Why does this happen im running on 1.7.2 Beta Build 2
-
View User Profile
-
Send Message
Posted Jan 9, 2014The sentries can't climb blocks.. when i add a target to a sentry it can only follow entities which are on the same block ( y level) and if the entity goes 1 block higher the sentry stops following him.
Citizens2 version: citizens-2.0.11 Sentry version: Sentry 1.8.0 Spigot version: git-Spigot-1233 (MC-1.7.2) (Implementing API version 1.7.2 - RO.3 - SNAPSHOT)
-
View User Profile
-
Send Message
Posted Jan 8, 2014Does anyone know what this error is caused by?
20:31:36 [SEVERE] java.lang.NoClassDefFoundError: net/minecraft/server/v1_6_R2/Packet
-
View User Profile
-
Send Message
Posted Jan 7, 2014Had to turn off Sentry after updating bukkit build to latest Beta version. Beside that worked great while I was using previous bukkit version. Hope to try this plugin again on Xinth server when it has its next update. Keep up the great work and happy coding.
-
View User Profile
-
Send Message
Posted Jan 7, 2014Whenever my sentries attack, their weapon disappears.
Their armor disappears when they are damaged. This problem has only just presented itself as it was working just fine up until now.
EDIT: The stuff is invisible and not gone. If I equip them, they drop their old stuff and wear the stuff I gave them.
-
View User Profile
-
Send Message
Posted Jan 6, 2014Hi, i run this plugin with Citizens build 2.0.10 and Sentry 1.6.1 and i have this error:
java.lang.NoSuchMethodError: net.citizensnpcs.api.npc.NPC.getEntity()Lorg/bukkit/entity/Entity;
plz help me with this error
-
View User Profile
-
Send Message
Posted Jan 5, 2014@EpicFaceXD
I can do that, but when I try to equip anything to the horse it just shows the 'hearts animation' and does not equip the armor. Even when I crouch it does the same thing. Do I have to turn something off?
-
View User Profile
-
Send Message
Posted Jan 4, 2014Weird question, but is there a way to get Sentries to work with mod-weapons without actually having to fork Sentries to accommodate those mods to begin with? Here's an even stranger idea I had that's probably not possible to do:
If a Sentry is equipped with an item not found in vanilla Minecraft, you can set them to do a "left-click action" or "right-click action" at "x" intervals for "y" amount of time per interval, with the mod-item in hand, as if they were in creative mode.
The idea is that this adds very rudimentary support for mods that, for example, would add a new bow type, or a mod like Flan's mod that adds guns.
With a new bow-type in hand, for instance, a sentry can be ordered, upon finding a target, to simply lock onto the target and "hold down" the right-click button for .7 seconds then release, and repeat this pattern every 2 seconds while locked onto the target. The reason why they should behave as if they were in creative mode is because creative mode doesn't require ammo for any mod-weapon - the only caveat is that they're invulnerable, so if you find a workaround for that, it would be great too.