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.
Is this working with the new mcMMO 1.4 betas?
@dragonflyz78
PLACE (on the seed id ).
USE = hit, interact, e.g. use fishing rod, hit with sword PLACE = place, e.g. building with wood BREAK = destroy block, e.g. mine PICKUP = allow picking up drops CRAFT = making the recipe for item(s). e.g. preventing making iron swords.
Remember you can have 1 or more actions per rule. Example: actions: [USE, PLACE, CRAFT]
HTHs
sorry to ask if i wanted to stop players placing carrot seeds would the action be [PLACE] or [USE]
@dragonflyz78
Correct :)
@Geekola
Thank you so if i wanted to make iron 40
rules:
Mining-Diamond:
description: 'mine diamond until level 50'
messages:
restricted: 'You cannot %s %s until level 50'
actions: [BREAK]
mcmmo:
skills:
mining: 50
items:
restrict: [56]
Mining-Iron:
description: 'mine Iron until level 40'
messages:
restricted: 'You cannot %s %s until level 40'
actions: [BREAK]
mcmmo:
skills:
mining: 40
items:
restrict: [15]
@dragonflyz78
Factions, mcMMO and Vault support are all optional so you don't need to have any of them to use this mod.
To answer your question, you can only get a level in a skill like mining by having mcMMO installed. Though you could make it so someone would have to be xp level 50 to mine.
To require someone to have level 50 mining with mcMMO, use something like:
To make it so that in vanilla, the player has to be xp level 50:
Note that this rule only prevents them from breaking a diamond ore block. You could also prevent them from picking up diamonds by adding PICKUP to the actions list.
HTHs
can i make this plugin work so that a player needs level 50 mining to mine Diamond i don't use factions. if some one can show me the code that will be brill
@Geekola
Thanks, I will try when I have time :D
@y1985
New version (awaiting approval) should do that. When you level up - it should tell you any restrictions that no longer apply or any new restrictions added.
Can you make this? If a player get level up, a message tells you whats you unlock.
@y1985
Wow, thanks loads for the bug hunt. You should sell your services!
Think I squashed/addressed everything there except the ability to use an item in a crafting recipe that was restricted. Will look to add this shortly. Let me know if you come across anything else.
Link to latest build above. Though It is currently awaiting approval.
nJoy
@Geekola
OK I will try that.
Also, I create a bunch of tickets about problems that I have found so you could take a look and track it one by one.
Thanks for create a wonderful plugin :D
@y1985
There is a bug where it is merging your config with the default config. Am looking into it now to sort it out, but changing the woodenStuff rule name to something else works on my current build.
Thanks again for all your help!
@y1985
Your rules look fine. Im going to set up a test server and try to duplicate. Have implemented notification of changes within rules so that will make it easy to track down the issue. BRB :)
@Geekola
Problem still exist. Its always when I reached Lv3 I won't be use the wooden equipment. Sometime when I reach the last restriction, wooden tools can be use.
http://pastebin.com/raw.php?i=1L4Mx5V7
@y1985
Double check as the default config has a max level setting on woodenEquipment. Maybe make sure if you change it you /reload. If the problem still persists, PM me or post your config and Ill see if I can figure it out.
Ahhh I see. I got typo
@y1985
use /rules to list rules affecting player.
To prevent xp loss from changing rules, you want to do a couple of things:
1. Instead of using xp in your rule, you need to use itemLevel. For example: Change this
to this:
Then in the xp section of your config, change to:
That will mean that the players xp will increase their item level, but when they lose xp, it won't decrease itemLevel.
Hope that makes sense. Thanks!
Is there a command like /can /cant in Levelrestrictions? and how to make use of an item when LV loss?