Sentry for Citizens2

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.


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.


A full list of commands and options is available on the Citizens 2 Wiki


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.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of mcmonkey4eva mcmonkey4eva Aug 17, 2014 at 20:48 UTC - 0 likes

    @CrazyPoloxD: Go

    That's... very strange, such an error shouldn't be possible. Try redownloading Sentry, and double check that you don't have two copies of Sentry in your plugins folder or anything like that.

  • Avatar of CrazyPoloxD CrazyPoloxD Aug 17, 2014 at 11:18 UTC - 0 likes

    Mine Problem [13:15:57 INFO]: xX98polo98Xx issued server command: /trait Sentry [13:15:57 WARN]: java.lang.ClassCastException: net.aufdemrand.sentry.Sentry cannot be cast to net.aufdemrand.sentry.Sentry [13:15:57 WARN]: at net.aufdemrand.sentry.SentryTrait.<init>( [13:15:57 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [13:15:57 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance( [13:15:57 WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( [13:15:57 WARN]: at java.lang.reflect.Constructor.newInstance( [13:15:57 WARN]: at java.lang.Class.newInstance( [13:15:57 WARN]: at net.citizensnpcs.api.trait.TraitInfo.tryCreateInstance( [13:15:57 WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.create( [13:15:57 WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.getTrait( [13:15:57 WARN]: at net.citizensnpcs.api.npc.AbstractNPC.getTraitFor( [13:15:57 WARN]: at net.citizensnpcs.api.npc.AbstractNPC.addTrait( [13:15:57 WARN]: at net.citizensnpcs.commands.TraitCommands.addTrait( [13:15:57 WARN]: at net.citizensnpcs.commands.TraitCommands.toggle( [13:15:57 WARN]: at sun.reflect.GeneratedMethodAccessor1949.invoke(Unknown Source) [13:15:57 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke( [13:15:57 WARN]: at java.lang.reflect.Method.invoke( [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.executeMethod( [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.execute( [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.executeSafe( [13:15:57 WARN]: at net.citizensnpcs.Citizens.onCommand( [13:15:57 WARN]: at org.bukkit.command.PluginCommand.execute( [13:15:57 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch( [13:15:57 WARN]: at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PlayerConnection.a( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PacketPlayInChat.a( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.NetworkManager.a( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.MinecraftServer.v( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.DedicatedServer.v( [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.MinecraftServer.u( [13:15:57 WARN]: at [13:15:57 WARN]: at [13:15:57 ERROR]: [Citizens] Cannot register a null trait. Was it registered properly?

  • Avatar of mcmonkey4eva mcmonkey4eva Aug 16, 2014 at 20:57 UTC - 0 likes

    @iSynn: Go

    You're running the not-latest build of Sentry. You're running a 1.7.9 Sentry on a 1.7.10 server. Sentry dev builds are available here:

  • Avatar of iSynn iSynn Aug 16, 2014 at 14:33 UTC - 0 likes

    I'm using the latest version of bukkit, citizens, and sentry. My previous sentries do not work anymore. The plugin broke after I updated to 1.7.10. Whenever i type /trait sentry, this appears.

    16.08 00:29:59 [Server] WARN at 16.08 00:29:59 [Server] WARN at 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.u( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.v( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.v( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.ServerConnection.c(SourceFile:134) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.NetworkManager.a( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.a( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.a( 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand( 16.08 00:29:59 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand( 16.08 00:29:59 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch( 16.08 00:29:59 [Server] WARN at org.bukkit.command.PluginCommand.execute( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.Citizens.onCommand( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.executeSafe( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.execute( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.executeMethod( 16.08 00:29:59 [Server] WARN at java.lang.reflect.Method.invoke( 16.08 00:29:59 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke( 16.08 00:29:59 [Server] WARN at sun.reflect.NativeMethodAccessorImpl.invoke( 16.08 00:29:59 [Server] WARN at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.commands.TraitCommands.toggle( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.commands.TraitCommands.addTrait( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.npc.AbstractNPC.addTrait( 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.npc.AbstractNPC.addTrait( 16.08 00:29:59 [Server] WARN at net.aufdemrand.sentry.SentryTrait.onSpawn( 16.08 00:29:59 [Server] WARN at net.aufdemrand.sentry.SentryTrait.ensureInst( 16.08 00:29:59 [Server] WARN java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R3/World

  • Avatar of mcmonkey4eva mcmonkey4eva Aug 14, 2014 at 20:26 UTC - 0 likes

    @Rkaynjehll: Go

    As I said on the Citizens issue page (Please don't multi-report!), it's "entity:player" not "type:player"

  • Avatar of Rkaynjehll Rkaynjehll Aug 14, 2014 at 16:42 UTC - 0 likes

    I'm using the very latest versions of Java (x64) Craftbukkit, Citizens2 and Sentry for 1.7.9 as suggested. I don't know if the issue is in citizens or sentry's code. I ran the following-

    /NPC Create Undead (Success) /Trait Sentry (Success) /Sentry Target Add Type:Player (Success)

    The created sentry refuses to detect/attack players. Tried logging out/back in, no changes.(inside or outside of sentry range)

    PvP is enabled for the server, tested it with a friend. Running no other plugins for testing purposes.

  • Avatar of CommodoreAlpha CommodoreAlpha Aug 09, 2014 at 08:22 UTC - 0 likes

    @mcmonkey4eva: Go

    Really? It mostly just has to do with bow-drawing, not even targeting? I suppose it's a compromise I can live with.

    Does that mean ANY bow draw would be absolutely fatal to the server? And also, if the problem stems solely from bow-drawing, would it be possible to have some way to eliminate the bow drawing animation and just have the NPC shoot the bow directly (like in the older versions of Sentry)?

    Last edited Aug 09, 2014 by CommodoreAlpha

    Sure, I'd love to include my server IP here. But it's under construction, and I wouldn't want to get sued for players wandering inside and getting hit by a random beam of steel floating about. And no, I doubt plugins would make very good lawyers either. I've never seen a plugin that forced you to sign a contract do so well.

  • Avatar of mcmonkey4eva mcmonkey4eva Aug 08, 2014 at 22:55 UTC - 0 likes

    @CommodoreAlpha: Go

    Both errors are Sentry/Cauldron incompatibility issues. Not much to do but convince the Cauldron devs to support NMS better.

    (Note: It's specifically the code that makes a Sentry draw its bow - which Cauldron doesn't support for some reason - it might work if you just... not use bow sentries)

    Last edited Aug 08, 2014 by mcmonkey4eva
  • Avatar of CommodoreAlpha CommodoreAlpha Aug 08, 2014 at 21:28 UTC - 0 likes

    I've gotten this error when a sentry hits a zombie. Anyone have any idea what it means?

    The NPC Sentry stops moving (as if its waypoint path was lost) and it gets disarmed for some reason.

    EDIT: I've also gotten this crash, which again seems to be coming from Sentry.

    I also use this on a Cauldron server, not CraftBukkit. Also, is there a possibility that the issues above are caused by getting hit too rapidly? (For reference, I'm referring to this plugin.)

    Last edited Aug 08, 2014 by CommodoreAlpha
  • Avatar of Silversbane Silversbane Aug 08, 2014 at 21:16 UTC - 0 likes

    I am using Sentry V 1.8.0 and am having an issue with the healrate.

    When I set it to 4.0 it is suppose to heal the sentry for 1HP every 4 seconds. Which it seems to do fine when he is in combat. But as soon as he is out of combat for even the smallest fraction of a second he will heal at insane speed from something like 70hp to 80hp in 1 second.

    Any idea why this might be happening? Any help would be much appreciated.

    Also any idea why my sentries are re spawning after a server restart even after they have been removed using the /npc remove command?

    Last edited Aug 08, 2014 by Silversbane

Your favorite Brigade?

  1. Choice:

  1. Results
  2. 1 comment


Date created
Sep 11, 2012
Last update
Jun 03, 2014
Development stage
  • enUS
Public Domain
Curse link
Sentry for Citizens2
Recent files