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.
@Geekola Socket can only drop, and not crafted. I'm thinking to make it not dropable and make it sell-only through "shopkeepers" plugin. Then restrict the trade item to be pickuped/crafted until some level ^_^. But if you gonna find something about restricting actions within furnace - should be awesome. Thanks for plug.
@demellion
Hmmm. I haven't tried this - but what about restricting the item from being crafted? Fairly sure offhand that the furnace screen governs crafting. Let me know either way!
@Geekola
No i mean not to block the furnace itself, but to block using some items to burn\being burned in it. I've got a DiabloDrops plug, which allows to insert sockets through furnace (but this plugin totally don't have any XP restrictions) so im using yours, and trying to deny the "socket" item to be "burned"
@demellion
What do you mean specifically? You can restrict/allow furnaces just like any other block. Specific actions like [USE] should do the trick :)
@demellion
There must be some other bug either with CommandBook or the build you are using. I could see CommandBook getting preference over /rules as it will have been loaded first (Bukkit loads plugins alphabetically) but thats why there are aliases ( /irrules ).
Here are a couple of links, one which explains how you could change /rules in ItemRules to something else:
explains the issue: http://dev.bukkit.org/server-mods/homespawnplus/pages/command-conflicts/ explains how to manually change the command: http://forums.bukkit.org/threads/conflicting-commands-with-mcmmo-and-mchat.86553/
Oh, one last thing. Are there any node for use in Furnace?
@Geekola
God. Ill burn in hell. Im using CommandBook, theres /rules command there. Thanks.
@demellion
One random thought... could it be a command conflict? e.g. another plugin using /rules ? I assumed there were failovers for that (hence why there are aliases). Just wondering outloud to see if it helps.
@demellion
Very. very. odd. The line that is throwing the error is as benign as they come. It is setting the command executor for the /rules command. Really basic, non threatening stuff.
Did you disable everything else and try the latest build? I know you said newer builds borked your other plugins, but this may be being caused by a bug in an old bukkit build combined with one of your other plugins. Like I said, I tested on several clean copies and I get no errors and everything works as expected :(
I want to help, but I can't if I can't reproduce the issue :(
That's what i get, maybe u can help me? Cause i can't see anything causing your plugin not even to launch.
-edit- Strange thing, it is actually working. 0_o
@demellion
Yup., Tried latest couple of builds and 2681 with Factions and with McMMO. Everything works as expected. No errors. Have you tried disabling all other plugins? Maybe reneabling one at a time?
Really? I am using Bukkit1.5.0-R.0.1-2681 (latest build crashes my plugins). I get the Cannot load plugin with NullPointerException in onEnable event.
@demellion
Are you having a specific issue? Just did a quick test against the latest bukkit and everything seems to work as expected
update please. ty(
@nicoit
Looks like it. Can you confirm the version of citizens you are running and paste your ItemRules and Citizens config so I can test and come up with a solution for you?
I'm getting this error, Is it a compatibility issue with citizens?
http://pastebin.com/6jDbCBFe
@sephstrom
You can get a little tighter with your rules to consolidate them a bit. Like I said below, all your rules were restricting the same items so I really couldn't help much there. So depending on what you're trying to do, you could remove each description except for the highest level one. Using woodcutting as an example, you would eliminate all descriptions apart from the highest level. Then use the following text for the description:
description: 'use in woodcutting.'
If a description is used, they are shown when displaying what rules a player is restricted to. Remove the descriptions, and nothing will show.
Hope that helps.
Just tested it with the new code, worked like a charm :D you sir are a gentleman and a scholar, thank you so much! I didn't know about the tabs with .yml, thanks for letting me know about that. I do have notepad, actually I use notepad and I'm a web design student hehe but haven't dabbled in .yml, just .html and tabs are no issue there.
Last quick question, when I log in, it now gives a giant wall of text to what is restricted and to what level. Anyway to not do that?
@sephstrom
Ok, the problem was all down to the config formatting. YAML is a ridiculously strict format. It especially HATES tabs. Anywhere. You always need to use spaces (either 2 or 4) per indent and always make sure you don't have any tabs after a line (there were a few of those). This: http://yaml-online-parser.appspot.com/ is a great resource to check your configs. Also, check your console/log as it will tell you where it is choking on your config.
I reformatted this one for you. I assume you know that they are all restricting the same items and that you were just testing :)
Woudl also recommend downloading notepadd (its free). You can change the settings so it puts spaces in instead of tab characters (very useful).
Also note I changed the flow lists from:
to
I honestly don't know if it makes a difference, but did it anyway :)
HTHs!
@sephstrom
I'll check it out tonight. Can you confirm the version of MCMMO you are using?