AnimalProtect
AnimalProtect
Created by Damo1995
As you may or may not have seen down in the comments below, World Guard is looking at implementing the function of this plugin into theres. Please click here to see what is going to happen and the way forward for this plugin
== What is AnimalProtect: ==
AnimalProtect is a simple but effective worldguard addon to block players killing animals inside regions they cannot build in.
The plugin will block any form of damage to the mob/animal including bow and arrows.
The plugin will also allow you to configure if you would like to protect hostile mobs inside regions too, this is disabled by default.
== How does it work? ==
AnimalProtect works by checking if the player has permissions to build in the area, either via region addmember or if they have the
bypass region protection built in op flag.
== Config file: ==
# Default Config for AnimalProtect notify: true notify-interval: 10 notify-player: true notify-outdated: true update-check: true shear-protect: true debug: false protect-from-player: - CHICKEN - COW - MUSHROOM_COW - OCELOT - PIG - SHEEP - WOLF - IRON_GOLEM - SNOWMAN - HORSE protect-from-monsters: - VILLAGER FailMessage: You cannot attack mobs here! RideMessage: You cant ride this Horse/Donkey! CommandFail: You lack the necessary permissions to perform this action. AdminNotification: Attempted to kill protected animals
for mobs that can be used in the config click here
== Commands: ==
/animalprotect - Public command to show plugin info.
/apreload - Reloads config.
/apupdate - Checks for updates - If enabled in config.
/aplist <type> - Types: Mobs, Players - List the protected animals.
/apunclaim- Allow players to unclaim horses.
/specialcommand <type> - No the command isent called specialcommand its called something else and it is for horses, But can you find it??
== Permissions: ==
animalprotect.admin - Everything
animalprotect.notify - Notify this player when player attempts to kill animal in protected regions.
animalprotect.bypass - Bypass protections
animalprotect.list - Allows aplist commands
animalprotect.update - Allows apupdate command
animalprotect.unclaim - Needed for the /apunclaim command.
== ToDo: ==
- Add support for use flag.
== Download ==
Source
Version 1.4.1: Download
Like my plugin? Would you consider donating a small amount to keep me encouraged?
@allix8
Fixed in version 1.3.0
Thanks for the report.
Also added shear protection in version 1.3.0
Players say that you can kill the monsters with a bow
@gabesarch
No not at the moment, if you would like this feature please suggest it under the ticket system.
Thank you.
Is there a way to make it so certain passive mobs bypass the killing in regions? Like when people are playing MobArena, they can't attack the dogs since the region is worldguarded.
This seems to be working as advertised! Thanks!
Update released.
Sorry for the long wait guys and girls.
I have just submitted a new version to bukkit which will fix the exception being thrown(Have tested and so far it seems to have worked).
Your plugin will notify you of the update if you have notify-update: true in config.
Thanks
I'm having the exact same problem with the error, using CB 1.2.5 RB 1.0, with AP 1.2.
My configs are all default except for the amount of messages being sent, where I set it to be 20 between each message.
I am receiving this error:
http://pastie.org/3880815
I am on CB 2175 and AP 1.2.0
@Infuscu
Please post your configuration file along with you bukkit version here Please
Thanks.
@damo1995
I cannot get it to work apparently .. I've given the administrator group the permission node 'animalprotect.notify' yet they don't receive any messages when I have my friend hitting mobs he's not allowed to (he gets a notification that he cannot attack mobs here).
I am receiving the following error, not sure why or when:
<<code>>
20:11:04 [SEVERE] Could not pass event EntityDamageByEntityEvent to AnimalProtect org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:363) at org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:381) at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:608) at net.minecraft.server.EntityAnimal.damageEntity(SourceFile:124) at net.minecraft.server.EntityArrow.F_(EntityArrow.java:214) at net.minecraft.server.World.entityJoinedWorld(World.java:1265) at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:106) at net.minecraft.server.World.playerJoinedWorld(World.java:1247) at net.minecraft.server.World.tickEntities(World.java:1154) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:542) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:449) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftSkeleton cannot be cast to org.bukkit.entity.Player at me.damo1995.AnimalProtect.DamageListeners.onEntityDamageEvent(DamageListeners.java:64) at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ... 14 more<</code>>
@Infuscu
Anybody who has the permission node animalprotect.notify or is a server op will receive a notification when a player attempts to attack a mob(depending on your configuration) You can use the notify-interval in the config to tweak how many seconds between each notification but this cannot be any higher then 20.
I cannot get the notifications to work - can you explain in details when and who will get notified in which cases?
@shutka
It shouldn't, If it does please let me know so I can look into the issue if it exists.
Submitted Version 1.2.0 to Bukkit.
Unfortunately no flag checks yet but the other stuff has been done. I plan on sorting the flag stuff at the weekend.
@damo1995
Config is always better, but doesn't matter for me.
Thanks for the quick response, look forward to the new version. I would also like to show my interest in the protection of villagers please and by default seems fine to me. Cheers!
@rodeyseijkens @LihPeu
I have added these into the to do list. I shall try and get a release out for either tomorrow or before the weekend.
@rodeyseijkens Would you like it configurable via Config or just by default?
Thanks so much, worldguard really needs this flag!
One question please, can I reduce the number of notifications a op gets when a player attempts to kill in a protected region? Perhaps a time interval between strikes, instead of each time the player strikes a animal?
Thanks you again, great work ;)