ItemRules
ItemRules is a simple to use, but highly configurable plugin for controlling how, when and even where items and blocks can be used, picked up, crafted, placed or broken based on the world, a players xp level, the faction they are in, their mcMMO skill level, their rank/group, their permissions, and more. It is a complete rewrite/revisioning of my previous plugin LevelRestrictions
Latest Builds
ItemRules can allow you to restrict items and blocks based on XP level and/or will integrate with Factions (e.g. allow only certain factions to use certain items), McMMO (e.g. restrict ores from being mined unless mining skill is a minimum level), Vault (e.g. restrict weapons based on permission group).
ItemRules will also allow you to configure certain rules that will be applied when players walk into defined regions (e.g. a PvP zone that only allows you to use carrots as weapons)
Configuration Examples
- Click here for details on configuring basic rules.
- Click here for details on configuring rules that only apply to specified areas.
Here is an example of restricting iron tools and equipment until player is level 2:
ironEquipment: description: 'Use of iron stuff until level 2' messages: restricted: 'You cant %s %s until level 2' actions: [USE, BREAK, PICKUP] xp: min: 2 items: restrict: [256, 257, 258, 267, 292]
Here is an example of McMMO integration that prevents cutting down Birch trees until woodcutting skill is level 2:
Woodcutting-Brichwood: messages: restricted: 'You cant cut birch until woodcutting 2' actions: [BREAK] mcmmo: skills: woodcutting: 2 items: restrict: ['17.2']
You can also specify rules to apply to groups (note this requires Vault) by adding this to your rule:
groups: applyto: ['newbs', 'badpeeps']
You can use the same format to exclude rules from groups (using Vault) like:
groups: exclude: ['vips']
Permissions
Note that by default all OP's will bypass rules.
permission | notes |
---|---|
itemRules.bypass.* | Do not process ANY rules for player |
itemRules.bypass.RULENAME | Do not process specific rule for player |
Commands
command | arguments | example | explanation |
---|---|---|---|
/rules | [playername] | list all rules currently applied to player. No arguments for self |
Change log
- v1.0.9 - Jun 21st, 2013
- Silent exception handling when Entity attacks player with an invalid item.
- v1.0.8 - Feb 18th, 2013
- Fixed potential issue with groups and perms not applying correctly.
- v1.0.6 - Feb 17th, 2013
- Fixed bug with certain manual rules not properly applying.
- Changed Item text to use Vault if installed.
- v1.0.5 - Feb 9th, 2013
- Changed permission check to prefer Vault (if installed) over Bukkit.
- Bugs zapped
- v1.0.3 - Feb 9th, 2013
- Changes mcMMO skill type checks to take advantage of their new api accepting strings instead of data types.
- v1.0.2 - Jan 30th 2013
- Added support for mcMMO versions with build newer than #1282 ( Jan 22nd 2013). Otherwise, same exact build.
Sorry if this is the wrong place to post this but I have a question. I'm using mcmmo with your plugin and I'm having trouble with the axes because on one hand I want people with a certain woodcutting level to unlock axes, but I also want people with a certain axes level to be able to unlock them as well. I've tried a couple different ways to make it so that they could use an axe if they had level 50 woodcutting OR axes, but it hasn't worked so far. Any help is appreciated.
Also as a quick note, for some reason even though my rules are working, if i try to do /rules, it always says "You have no rules applied to you."
@Shad0wSpl1c3r
Possibly. But unless someone has a good rationale, I'll most likely leave as is (v. 1.0.9 just ignores the item check on mobs). Mobs shouldn't really need an item check against the weapon it is using.
@Geekola
One little note on this; it could be an issue between Sentry/Citizens. I know that you can /npc equip (via Citizens2) to give an NPC an item, or you can use /sentry equip (via Sentry) as well... It could be that your plugin is reading a value from one of those, but getting a different result that it expects (due to the other plugin modifying it after).
I'm not too sure. Just a thought.
@Jo11yWombat
Hmmm. Maybe that is the logic flaw here. The error is coming from an entity causing damage to a player. This plugin isn't really designed to restrict mobs from attacking players with specific items, so maybe that is why it is barfing out (though to be fair, reviewing the code this morning stumped me as it SHOULD work that way even though it isn't designed to).
None the less, the 1.0.9 build won't give you these errors.
Thanks for helping!
Alright, so my suspicion is that it's due to my citizen carrying a diamond axe, although I'm not really sure. The associated plug-ins were: http://dev.bukkit.org/bukkit-plugins/citizens/ http://wiki.citizensnpcs.com/Sentry
To be fair I have a lot of other plugins running as well, but this never occured until I installed Sentry and actually spawned one in game. As he's not a real player I'm not sure how to go about setting permissions for him to hold items, I was thinking about changing around rules to only apply to specific groups, but it will take some time to set up.
Not sure what was causing the exceptions but a bad material in the entities hand would cause this to barf out. I have wrapped a silent exception handler to prevent it.
@Jo11yWombat
Can you provide whatever configs/info for me to reproduce? With that, I should be able to do something.
@Jo11yWombat
Same issue I was having. What plugins do you have?
Thanks for the awesome plugin. Unfortunately I'm getting an error popping up regularly in my console which lists your plugin in the report.
http://pastebin.com/mJECbBhA
The message started occuring after I set up a Sentry class Citizens 2 citizen, apparently every time he deals damage to anything. I wasn't sure if I should come to them or you about potentially resolving this conflict, or if there's anything I can do to resolve it on my own. Thanks for your time, and thanks again for the plug in.
@Shad0wSpl1c3r
Dude. You don't know what you're talking about.
I just spent the last 20 minutes testing for you again and I can tell you that it is working with the latest builds.
Your error is going to be the result of another of your 51 plugins. One that is specifically making
player.getItemInHand().getType() or player.getItemInHand().getData() return an NPE.
That is causing ItemRules to barf out. MC won't give you an NPE here so its another plugin.
Thanks!
@Geekola
I've seen enough plugins go sour to know when a plugin needs it's methods updated... :p I shall provide info again though.
CraftBukkit version git-Bukkit-1.5.2-R0.1-b2771jnks (MC: 1.5.2) (Implementing API version 1.5.2-R0.1)
I've tried about 5 different revisions of CB as well. From Dev to Rec.
http://pastebin.com/yJADQ0CV
http://pastebin.com/Pu59KCAm
@Shad0wSpl1c3r
Happy too if I had some indication as to what the problem is. All appears to be fine and working as intended at this end. Can you not provide more info for me to work from?
@Geekola
Do you plan on updating this plugin at all? Errors are getting worse, and now the plugin itself is unreliable. People only *sometimes* have rules applied to them, no matter what the setup.
@Geekola
I'm actually getting the same error, this time with McMMO. I think it's unrelated to your plugin. I am going to go through and update everything and see what happens.
[EDIT]: Actually, it is just your plugin now. It has errors due to the methods being out of date :P Console freaks out and throws errors on Blockplace, EntityDamageByEntityEvent, various inventory actions, block pickup, and anything that NPCs do.
When are you planning to release an update? I absolutely love your plugin :) It still works, I'm just sad at the console being unusable lol.
@Shad0wSpl1c3r
Just tried latest Citizens and this build and not having any errors. Can you pastebin your itemRules config, Citizens config and anything else that could help me?
@welknair
Just did brief test with latest beta build and works as expected
Am out of the country on holiday right now... Will check this out as soon as I'm back
Is this being updated to 1.5.1?
I'm getting an error with Citizens2 and ItemRules. It spams my console every time an NPC attacks something. http:pastebin.com/3YkXcjdp
Got another problem. I moved from CB to Libigot (1.5.1) and now have an error on player death/logout/login:
Plugin is not broken, just spams this.