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
It seems to be working just fine. There are a few area rules that I am having troubles with, but I am 90% sure those are on my end with coords
@Geekola
Your example worked but when I tried to adjust it to fit my needs it doesn't work.
@DoctorBeaver
Ok, think I found the issue and uploaded 1.0.6 (its awaiting approval right now, but linked in the Latest Builds section up top).
The only thing I did different on your config is to change mode from denyPrevious to deny (though you may have intended that). Otherwise I tested with your rules and it all looks good.
Let me know how you get on. Its great to see people using this mod to its fullest :)
@Geekola
@DoctorBeaver
Can you paste your config in code blocks?
@Geekola: Yes, I used a deopped character to test the rules. It worked when I just had a general set of rules in place. When I added in area rules, all of the rules stopped working.
I can send a link to my code if that would make it easier.
@DoctorBeaver
Have you tried deopping yourself first to test? By default, ops wont have any rules applied to them. Ops will need a negative itemRules.bypass.* applied to them.
When I start up the server, none of the rules are applied. I intend for them to be put on all non opped members, so I forewent the permissions file.
I've double checked my syntax and all of it seems to be right.
Is there any reason as to why it wouldn't work?
@Faldonboy
I have now had a chance to test with ItemRules (1.0.5), Vault (1.2.23-b301) and bPermissions(2.10.4) and everything works as expected with groups.
To test, I created a group called bob on my world and added me to it. I toggled the group setting in the rule below between 'exclude' and 'applyTo'. Both work as expected.
When the setting is 'exclude', the rule never applies to me. When set to 'applyTo' then it will explicitly apply to me (unless I am higher than xp level 10)
Does this help? If not, chuck me your config between code blocks and ill try to help!
Here is the rules set I tried:
Can you give an example of a rule using permissions exclude? I've tried but it doesn't seem to work, same goes for groups.(I have the latest vault installed which broke a lot of plugins dependent on it. You may want to look into it)
Using: Vault - 1.2.23-b301 ItemRules - 1.0.5 bPermissions - 2.10.4
@ursak
Can you post your entire config between code blocks? I just tested here and it works as expected ( other than for whatever reason, it reports ink dye as the text to the user, but that's easy enough to change in the config)
This:
Could not pass event InventoryCloseEvent to ItemRules v1.0.5
@Sir_Moodz
Sure. Just make a rule peeps will never reach. e.g.:
When using sub data ( e.g. ID:SUB), you surround in quotes and replace the : with a .
So birch logs become '17.2' and bonemeal becomes '351.15'
Is it possible to restrict the use of bonemeal with this? if so, example please, ty :)
@JAG100
Its not too hard to do code wise. In fact, am working on a zone reset plugin right now. Resetting works a treat (even for really large areas) on timers or switches. It move players, resets spawn and start points, respawns entities and will remove/empty/set players inventories.
Its not far off from being ready to test. If you want, ill give you a PM if you want to bash it around for me.
PS - you won't need to use it to reset areas, you can just use it to do the rest.
Hi G! I was hoping to pick your brain on something. I've got these adventure maps running under bukkit through bungeecord as separate servers. Working great. I'm using Multiverse Core, Inventory and Adventure to reset the worlds after players leave so that new players get the full experience. The ONE THING I haven't figured out yet is how to reset the darn inventory which was something I thought Multiverse Inventory in combination with Multiverse Adventure was suppose to do. How do you handle inventory resets? Am I missing something obvious perhaps?
Best, JAG100
@Geekola
Ah thanks. I figured out how the aliases works thought. Sure helps. :)
@ursak
Hey there, the XP options affect how rules with XP or itemLevel options work. If you aren't using any of those options in any of your rules, then it won't really matter.
Aliases are short hand ways to group item id's so you can refer to them easier. So instead of putting this in your code:
You can use:
This is useful to either keep your configs clean or for more complex rules ( e.g. rules that override other rules, or when using area rules).
If you are still having issues, feel free to paste your config here in code brackets so I can check it out.
HTHs!
@ursak
Nevermind. Got it working by changing true to false. I guess it only needed changing on DefaultsToXP?
XP: itemLevelDefaultsToXPLevel: false levelIncreasesItemLevel: false levelDecreasesItemLevel: false
Seriously thought. I didn't find any info on this.
And on the no-info-side. What does this even mean?
aliases: woodenEquipment: [268, 269, 270, 271, 290] ironEquipment: [256, 257, 258, 267, 292] stoneEquipment: [272, 273, 274, 275, 291] goldEquipment: [283, 284, 285, 286, 294] diamondEquipment: [276, 277, 278, 279, 293] miscWeapons: [261, 262]
Sure, I know what aliases are but I have no idea how it's used ingame by the plugin.
Ok. This seems to be beyond me. Can't get it to work. Is there something special I need to change to get mcmmo to work?
For Iron Pickaxe I have this for ex.
PickIron: description: 'use of iron pickaxe until level 1.' messages: restricted: 'You cannot %s %s until level 1' actions: [USE, CRAFT, BREAK] mcmmo: skills: mining: 10
And something is prob wrong, right?