EquipControl
EquipControl
Important
The config layout has changed in 0.4. If you update from a lower version, you need to update your config as well.
Read here for further details.
Summary
EquipControl let's you control which weapons/armor a player can use via Permissions.
You can define which items are checked, what makes this plugin as dynamic as possible.
As of 0.4 you can also restrict the use of named weapons/armor.
Usage
When using a weapon without the permissions, it will not deal any damage.
When wearing a forbidden armor it will moved into the player's inventory after closing it. If it's full the armor will be dropped.
Permissions
Armor Permissions:
equipcontrol.armor.<id>
equipcontrol.armor.<material>
equipcontrol.armor.<material|id>.<nametag>
Weapon Permissions:
equipcontrol.weapon.<id>
equipcontrol.weapon.<material>
equipcontrol.weapon.<material|id>.<nametag>
<id> is the ID of this Item, <material> is the material name defined in bukkit.
<nametag> is the key, used in config, to identify restricted Itemnames.
You can find a list here: Link (1.1)
Config
Only Item-IDs are allowed.
Nametags/keys must be unique in every item but can be duplicated in different items.
IMPORTANT If you use formated item names (like color), you NEED to specifiy the format code in the item name. (§<code>)
To add Items without name restriction, put them under the list: section.
For items with name restriction create a new section
<id>: <nametag1>: "<name of the item>" <nametag2>: "<name of the item>" <nametagX>: "<name of the item>"
Default config:
checked_weapons: list: - 267 - 268 - 272 - 276 283: nametag: "Thors Hammer" checked_armor: list: - 299 - 300 - 301 298: namekey: "Just a Hat" string: weapon: "You don't have the needed permissions to use this weapon" helmet: "You don't have the needed permissions to wear this helemet" chest: "You don't have the needed permissions to wear this chestplate" leggings: "You don't have the needed permissions to wear this leggings" boots: "You don't have the needed permissions to wear this boots" namedarmor: "You don't have the needed permissions to wear %item%" namedweapon: "You don't have the needed permissions to use %item%" CheckArmorOnDamage: false CheckArmorPeriodical: false CheckArmorTimer: 30 #time in seconds useItemName: false
Source
Get the source on GitHub
@lolball5gold
Thanks for your suggestion.
I just uploaded version 0.5, which includes aditional checks for armor, which should solve your problem. Activate them by adding 'CheckArmorPeriodical: true' and/or 'CheckArmorOnDamage: true' to your config file.
hi, I have a small suggestion and problem, I use a self promoting plugin which promotes players ingame with money , (masterpromote) <sub>, I have rank A and rank B , in rank A your allowed to wear diamond armor , in rank B your not allowed to wear diamond armor, if that person from rank A is wearing that armor and buys rank B at the same time, the diamond armor is still worn and he can wear any diamond armor , is there a way you could fix this please? </sub><sub>, also if I have armor abilities , will the plugin still block diamond armor ? if its now allowed (armor abilities bukkit) thanka</sub>
@crore
The plugin should only test for Names, specified in config. If you use a item with another name, which isn't specified in config it will be handled like an unnamed Item.
is there a way to make it so i dont have to list every name item seems like when people name an item it make all this void until i add the named item.... this is very ez to get around
Much better ty.
Yep I'll give it a try. I'll post here if it works. Thank you.
@LttlMaster
Should not happen... Try it with 0.4.2, maybe it helps^^
@Mavhill
should be fixed in 0.4.2
Hey im getting this error now with the latest 2 versions 2013-01-24 17:04:10 [SEVERE] Could not pass event EntityDamageByEntityEvent to EquipControl v0.4.0 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at org.bukkit.craftbukkit.v1_4_6.event.CraftEventFactory.callEvent(CraftEventFactory.java:81) at org.bukkit.craftbukkit.v1_4_6.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:369) at org.bukkit.craftbukkit.v1_4_6.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:391) at net.minecraft.server.v1_4_6.EntityLiving.damageEntity(EntityLiving.java:686) at net.minecraft.server.v1_4_6.EntityAnimal.damageEntity(SourceFile:122) at net.minecraft.server.v1_4_6.EntityHuman.attack(EntityHuman.java:804) at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:1115) at net.minecraft.server.v1_4_6.Packet7UseEntity.handle(SourceFile:36) at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290) at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:112) at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39) at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30) at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:598) at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224) at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494) at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427) at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849) Caused by: java.lang.NullPointerException at de.syd.equipcontrol.EquipControl.getWeaponExtraPerm(EquipControl.java:197) at de.syd.equipcontrol.EquipControl.onDamage(EquipControl.java:212) at sun.reflect.GeneratedMethodAccessor106.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:425)
It was put into the same folder I found it and yes.
@LttlMaster
Sounds strange. Is the config file located in the correct folder? Did you restart the server after changing the config?
I have changed my config to only check for diamond and iron gear. However when using other materials (wood for instance) it still shouts out you don't have permission to use that. It also uses the default message "You don't have the permission..." when I changed that too. What did I break?
http://pastebin.com/1LmsLYZy
@crore
Use the seconds one (the 4 permissions)
Also the error mentioned below will be fixed in the next update.
@crore
ok so i figured out the error... was named item i was using to attack with. now the restriction is working but to well... if i am to let my thief rank only wear leather armor i would add in the permissions node is this correct?
or
doesnt seem to be working properly when i hit soemthing wiht the sword it still does damage and the armor stays on when i put i on as a rank not aloud this is the error i get on hitting something with illeagle items http://pastebin.com/hPW1TdYV
this is my config file
http://pastebin.com/KjGd08SA
@blackaciddevil
I can't find the src of the Sentry NPC, but most certainly it's a error with the Sentry Addon. I would suggest to contact the author of the Sentry Addon, as I can't fix it.
I checked it again and it worked on regular Citizens 2 NPC's but not on the add-on Sentry NPC's. Nothing you will add I guess (if possible)? I really hope so anyway.
GREAT plug-in in btw! Thanks!
@blackaciddevil
I´m just listening to the EntityDamageByEntity Event and cancel it, if there is a permission mismatch. So I would suspect Citizens to not handle canceled events properly...
"When using a weapon without the permissions, it will not deal any damage" - it does to citizens 2 npc's.
I was just wondering if this plugin works with citizens 2/sentry/dtltrader etc or if I'm doing something wrong. If not would it be possible with an update that makes it compatible with it?
Thanks for updating the plugin, but can you add block breaking restriction so that tools can be restricted as well? :D
- Goat
thank you for this plugin! seems to work fine with 1.4.2
Lou