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 Mar 27, 2014Something strange, If I equip a sentry with an item with Lore. Such as a '&bGuardian_Sword' Then the plugin will work until reload. upon reload Sentries will drop swords that are named '?bGuardian Sword'
Why are & changing to ? on reload?
Thanks
-
View User Profile
-
Send Message
Posted Mar 25, 2014@baemboo
That's ... odd. They're fairly world-nonspecific. Any details on what "dont work" means? Is there an error? Are they acting weird? What exactly is going on?
-
View User Profile
-
Send Message
Posted Mar 25, 2014We got a problem with multiverse worlds. We got no problems in our main world called "world", but sentry and quester npcs dont work in other worlds. help would be nice
-
View User Profile
-
Send Message
Posted Mar 24, 2014@chsedv
Update on my previous comment, sooner than I expected:
a 1.7.5 compatible build (Sentry v1.8.1) is available on the wiki at http://wiki.citizensnpcs.co/Sentry and as build #8 on the Citizens development repo http://ci.citizensnpcs.co/job/Sentry/
-
View User Profile
-
Send Message
Posted Mar 24, 2014@chsedv
I'll be releasing a 1.7.5-compat. dev build on the wiki soon... after confirming Denizen and Citizens work 100% on 1.7.5, as those are higher priority.
(Likely won't be an official build on this DBO page any time soon, unless jrbudda un-dies again)
-
View User Profile
-
Send Message
Posted Mar 24, 2014Not working with Bukkit 1.7.5-R01. Pls Update
[20:01:50] [Server thread/INFO]: [Citizens] The trait sentry failed to load for NPC ID: 248. [20:01:50] [Server thread/ERROR]: [Citizens] An exception occurred while the trait sentry was spawning for NPC ID 248. [20:01:50] [Server thread/WARN]: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R1/World [20:01:50] [Server thread/WARN]: at net.aufdemrand.sentry.SentryTrait.ensureInst(Sentr yTrait.java:136) [20:01:50] [Server thread/WARN]: at net.aufdemrand.sentry.SentryTrait.onSpawn(SentryTr ait.java:117) [20:01:50] [Server thread/WARN]: at net.citizensnpcs.npc.CitizensNPC.spawn(CitizensNPC .java:196) [20:01:50] [Server thread/WARN]: at net.citizensnpcs.npc.CitizensNPC.load(CitizensNPC. java:114) [20:01:50] [Server thread/WARN]: at net.citizensnpcs.api.npc.SimpleNPCDataStore.loadIn to(SimpleNPCDataStore.java:59) [20:01:50] [Server thread/WARN]: at net.citizensnpcs.Citizens$2.run(Citizens.java:295) [20:01:50] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_7_R2.scheduler.CraftTask .run(CraftTask.java:58) [20:01:50] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_7_R2.scheduler.CraftSche duler.mainThreadHeartbeat(CraftScheduler.java:345) [20:01:50] [Server thread/WARN]: at net.minecraft.server.v1_7_R2.MinecraftServer.v(Min ecraftServer.java:618) [20:01:50] [Server thread/WARN]: at net.minecraft.server.v1_7_R2.DedicatedServer.v(Ded icatedServer.java:273) [20:01:50] [Server thread/WARN]: at net.minecraft.server.v1_7_R2.MinecraftServer.u(Min ecraftServer.java:566) [20:01:50] [Server thread/WARN]: at net.minecraft.server.v1_7_R2.MinecraftServer.run(M inecraftServer.java:472) [20:01:50] [Server thread/WARN]: at net.minecraft.server.v1_7_R2.ThreadServerApplicati on.run(SourceFile:618) [20:01:50] [Server thread/WARN]: Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_7_R1.World [20:01:50] [Server thread/WARN]: at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:67) [20:01:50] [Server thread/WARN]: at org.bukkit.plugin.java.PluginClassLoader.findClass (PluginClassLoader.java:62) [20:01:50] [Server thread/WARN]: at java.lang.ClassLoader.loadClass(Unknown Source) [20:01:50] [Server thread/WARN]: at java.lang.ClassLoader.loadClass(Unknown Source) [20:01:50] [Server thread/WARN]: ... 13 more
-
View User Profile
-
Send Message
Posted Mar 23, 2014Thnx mc! Updating targets fixed gluich. Thank you!
-
View User Profile
-
Send Message
Posted Mar 23, 2014@CanandianVolchik
- First, make sure you've added "entity:monster" or "player:volchik" or whatever so it knows to attack you.
- Second, Sentry has quite a few weird bugs and limitations... one of which is that you have to wait about a minute after changing its targets before it will really notice them. So set it up, wait a bit, then leave and come back. It might help to let it retaliate against an attack, then either win or have its attacker get away, which should also force it to update its target settings and beginning attacking as planned after.
-
View User Profile
-
Send Message
Posted Mar 23, 2014Hey guys. I have wierd problem. My sentres will not attack unless provoked by attack first.
Basically even they have a monsters as a default target, they do not attack monster until monster attacks them first. Same with people. If I make player or even myself a target. They don't attack until player hits them. I can't figure out what is wrong. Is anyone had problem like that before? Please help me. I am out of ideas.
-
View User Profile
-
Send Message
Posted Mar 22, 2014@EmpiresCraft
Yup, its mob-handling functions could definitely do something like that if you don't disable it for horse-type entities... I'm not so sure pTweaks has an option to specifically ignore individual mobs, so you might have to disable mob handling entirely and find a different plugin to deal with that.
-
View User Profile
-
Send Message
Posted Mar 22, 2014@mcmonkey4eva
Thanks for all the advice!
-
View User Profile
-
Send Message
Posted Mar 22, 2014@mcmonkey4eva
So possibly a lag clearing plugin, suck as pTweaks?
-
View User Profile
-
Send Message
Posted Mar 21, 2014@EmpiresCraft
Something has to have happened to the mount - perhaps a different plugin is blocking mob spawns, and doesn't know to let the NPC through... or something like that? It doesn't just arbitrarily despawn on its own.
-
View User Profile
-
Send Message
Posted Mar 20, 2014Hello, I've found a problem with mounts, I believe. When a sentry is mounted, it will run fine, but after awhile, the mount will despawn and the sentry will be left standing there unresponsive. Any way to fix this?
-
View User Profile
-
Send Message
Posted Mar 20, 2014@lucasbuck2
Yeah just use "/trait sentry" and they'll revert too 100% normal non-Sentry NPCs without any trouble. Citizens is designed to be modular and very efficient with this kind of thing!
EDIT: Oh, and if you're ever curious what data exactly is stored on an NPC, you can open up the file "plugins/Citizens/saves.yml" in a text editor. All the data is in a clean, human-readable YAML format.
-
View User Profile
-
Send Message
Posted Mar 20, 2014@mcmonkey4eva
Thanks for the quick reply. I just use the town ones for taking quests, so maybe it would be better if I put them in different areas. If nobody's around, they wouldn't be loaded anyway.
But when I first started the server and was learning, I just set them all up as sentrys. They just stand there and are linked to the Quests pluginn, so don't need them for any other use. Can I just do /trait sentry again and remove it, or would it be better to remake them? (Didn't know if they completely put them back to normal, less resource using, npcs)
-
View User Profile
-
Send Message
Posted Mar 19, 2014@lucasbuck2
- A sentry has significantly more resource usage than an empty NPC, as it has to watch all entity / player movement in case it needs to react / attack
- How much to space it out depends entirely on how strong your server is. For example, on my relatively low-power (1 gig RAM, cheap processor) testing server, I have about 10 Sentry NPCs guarding against mobs over a small (200x200 block) city, and while it uses a fair bit of power, it's still not enough to create lag. In a public server, I have a larger city with more guard NPCs and a huge pile (10-20 NPCs) of personal guard NPCs that got 'lost' (and thus we just shoved them all into one building to await the return of their owner) in the middle... it's not enough to lag the server, but it does drop the FPS for clients a bit.
- The above is a rough starting point, but I'd recommend you try spawning different arounds of NPCs in different densities and areas and so forth to test your servers ability to handle it... generally you want to find out how much is enough to cause lag, and limit yourself to half that amount (you always want lots server power to spare!)
EDIT: Oh, and NPCs despawn when there aren't any players nearby... so no need to worry about far away NPCs!
-
View User Profile
-
Send Message
Posted Mar 19, 2014I'm using Citizens and Sentries on my educational server and was wondering if there are any tips on how many is too many in an area? I use them in town to give quests, and some as bosses outside. But as I plan their locations (mainly the in town quest giving ones) I was wondering if I should space them out? If so how far? Do the cause any lag if nobody is in the same chunk? Etc. Appreciate any tips or experiences? OH, almost forgot, does setting the type to Sentry make any difference to the resource usage rather than just a regular Citizen?
-
View User Profile
-
Send Message
Posted Mar 18, 2014@ThaRam
That's just /sentry respawn #
Where
# is the time... see the wiki for more info: http://wiki.citizensnpcs.co/Sentry#Stats-
View User Profile
-
Send Message
Posted Mar 18, 2014is there not an option to change re-spawn times? or disable re-spawns all together?