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.
@NuiluChu
I've got the exact same error. :(
Hey so uh... I'm getting this really really weird error when I select an npc and do ./trait Sentry and I'm not really sure what it means at all... can anyone help me?
This is the error: java.lang.NoClassDefFoundError:net/minecraft/server/v1_7_R3/Packet
@CrazyPoloxD
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.
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>(SentryTrait.java:25) [13:15:57 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [13:15:57 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [13:15:57 WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [13:15:57 WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [13:15:57 WARN]: at java.lang.Class.newInstance(Class.java:374) [13:15:57 WARN]: at net.citizensnpcs.api.trait.TraitInfo.tryCreateInstance(TraitInfo.java:41) [13:15:57 WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.create(CitizensTraitFactory.java:110) [13:15:57 WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.getTrait(CitizensTraitFactory.java:117) [13:15:57 WARN]: at net.citizensnpcs.api.npc.AbstractNPC.getTraitFor(AbstractNPC.java:242) [13:15:57 WARN]: at net.citizensnpcs.api.npc.AbstractNPC.addTrait(AbstractNPC.java:90) [13:15:57 WARN]: at net.citizensnpcs.commands.TraitCommands.addTrait(TraitCommands.java:59) [13:15:57 WARN]: at net.citizensnpcs.commands.TraitCommands.toggle(TraitCommands.java:152) [13:15:57 WARN]: at sun.reflect.GeneratedMethodAccessor1949.invoke(Unknown Source) [13:15:57 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [13:15:57 WARN]: at java.lang.reflect.Method.invoke(Method.java:606) [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.executeMethod(CommandManager.java:153) [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.execute(CommandManager.java:90) [13:15:57 WARN]: at net.citizensnpcs.api.command.CommandManager.executeSafe(CommandManager.java:177) [13:15:57 WARN]: at net.citizensnpcs.Citizens.onCommand(Citizens.java:236) [13:15:57 WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [13:15:57 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [13:15:57 WARN]: at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [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(MinecraftServer.java:667) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [13:15:57 WARN]: at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [13:15:57 ERROR]: [Citizens] Cannot register a null trait. Was it registered properly?
@iSynn
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: http://ci.citizensnpcs.co/job/Sentry/
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 net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:469) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:558) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:258) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:667) 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(NetworkManager.java:157) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat.java:47) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java:28) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:818) 16.08 00:29:59 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerConnection.java:957) 16.08 00:29:59 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:740) 16.08 00:29:59 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) 16.08 00:29:59 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.Citizens.onCommand(Citizens.java:236) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.executeSafe(CommandManager.java:178) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.execute(CommandManager.java:90) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.command.CommandManager.executeMethod(CommandManager.java:154) 16.08 00:29:59 [Server] WARN at java.lang.reflect.Method.invoke(Method.java:606) 16.08 00:29:59 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16.08 00:29:59 [Server] WARN at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 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(TraitCommands.java:152) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.commands.TraitCommands.addTrait(TraitCommands.java:59) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.npc.AbstractNPC.addTrait(AbstractNPC.java:90) 16.08 00:29:59 [Server] WARN at net.citizensnpcs.api.npc.AbstractNPC.addTrait(AbstractNPC.java:111) 16.08 00:29:59 [Server] WARN at net.aufdemrand.sentry.SentryTrait.onSpawn(SentryTrait.java:116) 16.08 00:29:59 [Server] WARN at net.aufdemrand.sentry.SentryTrait.ensureInst(SentryTrait.java:134) 16.08 00:29:59 [Server] WARN java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R3/World
@Rkaynjehll
As I said on the Citizens issue page (Please don't multi-report!), it's "entity:player" not "type:player"
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.
@mcmonkey4eva
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)?
@CommodoreAlpha
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)
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.)
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?
@mcmonkey4eva
Its actually really interesting. The health will go up as if it is healing (I have healrate set) but as soon as health reaches 25 it jumps back down to 20.
Upon further inspection, I've found the value at which health jumps back down, changes with the health amount set. It always jumps down to 20 though.
I put pathrange to 25. I cannot avoid teleportation, they dont want to walk. u.u
@Ajaxan
What does /sentry info show?
I've found that I can't set npc health above 20. I use the normal command, (/sentry health #) but no matter what they die after taking 20 damage. Is this just the way it is or is there something I'm missing?
@FrancoEsFeliz
They only walk to points within their pathrange (/npc pathrange) defaulting to 25. If you want to avoid teleportation, move waypoints closer together.
I have a problem. When i spawn a npc, he teleports to the next waypoint. How do I make he walk?
@jrbudda
help me 1.7.9 my server but does not work
Is there any way for a Sentry not to deal or take damage in Worldguard pvp-protected regions?