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.
Still giving me "No Rules". Is there some kind of permissions or possibly something that needs to be put in with the world name for the whole file?
@sephstrom
Not sure if it is the codebox indenting incorrectly or if this is the issue:
Your rule names need to be "out" dented and the details indented like:
Check that and let me know.
I am OP yes but I figured I would override them. I was testing it with another person who is not though. Also I know all the items listed are the same minus one, iron pickaxe. Haven't changed them yet, was just testing with the pickaxe.
@sephstrom
Are you an OP? If so, note that by default, OP's don't have rules applied to them. You need to add a negative permission for: itemRules.bypass.*
If that isn't it... post me your config between code brackets.
I can not seem to get this plugin to work at all. I've been trying to combine it with mcMMO but nothing is working. It just tells everyone when they do /rules that they have no rules.
@Faldonboy
Odd. That code is the one that says "levelup" and then re calculates their rules.There isn't any process or add on that may change the mcMMO level of an offline player is there? If so, that would certainly cause the error.
This error has been showing up a lot.
It would be great if this could limit the number of items of some time that a player can place.
This looks rather handy! Thanks, I'll give you feedback when I get a chance to test it out.
@Faldonboy
Awesome. Thanks for your help in finding a rather elusive bug :)
@Geekola
Ugh, my hero. Everything works with 1.0.8, thank you!
@Faldonboy
Ok... think I may have found the issue.
First off was a typo in my rules below. The parameter isn't "applyTo" - it is "applyto".
Next, I found and fixed a couple bugs related to when excluding perms or groups. So between not applying groups/perms and not really excluding them - that may have been the problem.
Try 1.0.8 and let me know if that helps.
@Geekola
06:21:40 [INFO] bPermissions version 2.10.4 06:21:46 [INFO] Vault version 1.2.23-b301 06:21:53 [INFO] ItemRules version 1.0.5
Can't be a plugin conflict, I just took everything out except those three plugins, same problem.
I wasn't able to place Villager spawners at all(even when my rank was set to bob). And, I was able to still place cow spawners(without having the permission that is supposed to exclude me from the rule). Tested as a non-op and an op with the bypass permission negated.
@Faldonboy
Can you confirm that the versions of bPerms, Vault and ItemRules are as I used ( posted below)? Could it be some other plugin causing a conflict?
@Geekola
Positive that I'm not opped, and now I'm really confused as to why it doesn't work for me, I copied the example you just posted exactly and it doesn't work, instead the first one for villagers is completely preventing me from placing a villager spawner(regardless of what group I'm in). The second one for cows doesn't even show up as a rule when I do /rules(or when I log in) and I can place cow spawners.
@Faldonboy
Ok, downloaded a stable SilkSpawners to test out and hate to say it, but it all appears to work perfectly for me even without the qualifier. Are you sure that you aren't opped when testing this? If so, unless you give yourself a negative permission on - itemRules.bypass.* then none of the rules will ever process for you.
Here are the rules I was testing. One using groups, one with a custom perm. Note that the USE action on these rules won't really do anything as you don't "use" spawners (they use you!)... er... or is that what you're after? Preventing the spawner working?
@Geekola
Mob spawners can be obtained by using a give command or any plugin that allows the replacement or spawning of items with data values by spawning a mob spawner with a data value identical to the mobs network ID(so 52:120 in the case of villager or 52:99 for iron golem) etc, they use tile data to store the mob type so without a plugin that can retain that data when the spawner is picked up they will lose it and revert to a pig spawner when placed. I have plugins allowing spawners to be mined/placed but I want to limit who can place these spawners with ItemRules.
Yes adding a qualifier to the rule(mcmmo, xp or world)makes the rule work but without being able to exclude groups from the rule it doesn't help much.
@Faldonboy
One other idea Faldon... try a qualifier in your rule. As in:
@DoctorBeaver
Good to hear. Let me know if you need any more help, find any other bugs or have any good ideas.
@Faldonboy
What are you using to get villager spawners? I suspect I may not be able to control that as I can't even find an id in Bukkit for it. Will look more into it tomorrow.
Are Villager Spawners something your players can have access to?