ItemRules

Screenie

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

Screenie

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

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.

permissionnotes
itemRules.bypass.*Do not process ANY rules for player
itemRules.bypass.RULENAMEDo not process specific rule for player

Commands

commandargumentsexampleexplanation
/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.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of kev3200 kev3200 Oct 13, 2014 at 19:18 UTC - 0 likes

    @kev3200: Go

    Update: Didn't work... I tried doing /irapply kev3200 birchWood /reload server, and then /rules kev3200 "You have no rules applied to you." I can make a video if you want if that would help to show you my problem and what I'm trying to accomplish.

  • Avatar of kev3200 kev3200 Oct 13, 2014 at 19:12 UTC - 0 likes

    @Geekola: Go

    Ok I think I get it now. So if I want the rules to be applied permanently, once the player reaches a certain level for instance, I would need to give them the permission and /irapply <playername> <rule> to refresh the rule list. Next time they login, the plugin "sees" that they have the permission and will reapply the rule automatically, yes?

  • Avatar of Geekola Geekola Oct 13, 2014 at 10:37 UTC - 0 likes

    @kev3200: Go

    I haven't tested (and wrote this over a year ago so commenting from memory). I made a long reply, but let me see if I can sum it up better: those commands apply/remove a rule, but that effect is temporary until rules are automatically re-evaluated (e.g. next time they log on). IF a rule requires x permission, you give the player that permission, then next time their rules are re-evaluated, they will have that rule. IF you give them that permission and run /irapply "rule" that will manually apply and refresh their rules in the interim. However: IF a rule requires x permission and you do not give them that permission but run /irapply "rule", then they will have the rule applied until the next time their rules are evaluated (e.g. when they next log in). Hope that help clarify!!!

    BFAK:90760905,1b5996d6759b0a201012eb8c7f01da6babcd833b472bac57adf1a91590dded21

  • Avatar of kev3200 kev3200 Oct 12, 2014 at 20:18 UTC - 0 likes

    @Geekola: Go

    So using /irapply and /irrevoke, would those rules stay on or off the player permanently? Or only for the duration of one login?

  • Avatar of Geekola Geekola Oct 10, 2014 at 13:34 UTC - 0 likes

    @kev3200: Go

    Looks like commands are: irapply and irrevoke "playername" "rulename" (without quotes). It also doesn't look like it gives feedback.

    In your instance, if you base your rules on permissions, you could possibly use an empty rule that can be applied/removed just so it refreshes the users current rules (which would then be revaluated next time they login).

  • Avatar of kev3200 kev3200 Oct 10, 2014 at 12:29 UTC - 0 likes

    @Geekola: Go

    K, so I understand how the commands work, but what is the syntax for using them? is it: "/apply <playername> <rulename>"? Cause when I try that in the console there is no feedback. Also, I have disabled the xp levels having any correlations with the player's levels in LevelMe. (assuming that's what you are referring to). I want to be able to add all the rules manually via commands issued by the console. That way the rules/permissions a player has will not be tied to their xp level but instead to their level in certain categories (woodcutting, mining, etc.).

    P.S.(Yes I am using Vault)

    Last edited Oct 10, 2014 by kev3200
  • Avatar of Geekola Geekola Oct 08, 2014 at 23:14 UTC - 0 likes

    @kev3200: Go

    Those 2 commands enable you to manually add or lift a rule. e.g. if you have a rule called "IronGear" you could add it to someone who otherwise didn't have it applied or remove it. The problem here is that rules are automatically reapplied at particular intervals (e.g. someone gaining an xp level). That will override the manual apply/removal.

  • Avatar of Geekola Geekola Oct 08, 2014 at 23:12 UTC - 0 likes

    @kev3200: Go

    I am assuming I can hook into a vault perm change even to reload - but that is just me assuming (just like I am assuming you use Vault)

  • Avatar of kev3200 kev3200 Oct 08, 2014 at 12:24 UTC - 0 likes

    Another question:

    I see the plugin recognizes two commands that aren't on the list of Commands on this page. /apply /revoke What do these commands do, what is the syntax for using them? When I try them in game there is no message on how to use it.

  • Avatar of kev3200 kev3200 Oct 06, 2014 at 12:41 UTC - 0 likes

    @Geekola: Go

    So here's my problem. Maybe you can think of a clever solution. I have my itemRules config set to exclude a rule from players with a certain permission. I'm using a command to add a permission node to a player (PEX) using a separate plugin. The problem is, once the permission has been added, itemRules doesn't seem to know there has been a change to the player's permissions and doesn't exclude them from the rule. Is this an itemRules problem or is there a way I can work around this? Using PermissionsEX for permissions and levelMe (different plugin) for adding the permission to the player.

Facts

Date created
Jan 27, 2013
Category
Last update
Jun 27, 2013
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
ItemRules
Downloads
2,995
Recent files

Authors