ItemRules

Rule Configuration

This section outlines the various options available to you for configuring your rules in your plugins/itemrules/config.yml

Rules in your rules: section are processed and applied automatically when a player logs in, levels up, respawns, changes factions, etc...

For illustration, here is an example of a rule that restricts the use of diamond swords to players whos XP level is less than 5:

rules:
    diamondEquipment:
        description: 'use of diamond equipment until level 5' 
        messages:
            restricted: 'You cannot %s %s until level 5'
        xp:
            min: 5
        actions: [USE, CRAFT]
        items:
            restrict:
            - 276

In the example above, diamondEquipment is the unique tag/name for this rule. It is important to note that rules are processed and applied in order so rules further down the list can overwrite earier rules.

Note on options

Notes on lists


        actions: [USE, BREAK, PLACE]

is the same as:

        actions:
        - USE
        - BREAK
        - PLACE

Using item ID's


When listing itemids, you can use just the number. e.g. 17 will apply to ALL logs. If you want to specify a specific type item, use a period to seperate the main type from the sub type and put in quotes. In other words, to specify birch logs, use '17.2'

Basic rule options


settingsub optionexamplenote
worldsLeave out to have this rule apply to all worlds on your server
applyTo['world', 'world_nether']A list of worlds that this rule will be processed in. Generally not used in conjunction with the exclude option below
exclude['world_nether']A list of worlds that are excluded from processing this rule. Generally not used in conjunction with the applyTo option above.
description'use of diamond tools until level 5'the description is displayed to players as summary of the rule when they type /rules or login
messagesthe first %s is a placeholder for the action text. The second %s is a placeholder for the material/item text
allowed'you can %s %s'description shown when user is explicitly allowed to use item. Leave out or blank for no text.
restricted'you cannot %s%s'text shown when user cannot perform action with item because of rule
actions[USE, PICKUP]a list of actions that this rule applies to. Options are: BREAK, PICKUP, PLACE, USE, CRAFT
xp
min2This is the minimum XP level that the user needs to be to perform action on item. Leave out for no minimum level
max4This is the max XP level the player needs to be to perform action on item. Leave out for no maximum level
items
allow[276, 277]Item ID's explicitly allowed when this rule applies to player. Leave out unless you are "overwriting" a previous restriction
restrict[283, 285]Item ID's explicitly restricted when this rule applies to player. Enter in quotes and use a . when entering sub types. e.g. entering 5 will restrict ALL wood planks. Entering '5.3' will restrict Jungle Wood planks
permissionsAllows you to create custom permissions for rule. Leave out to have apply to all users who do not have the bypass permission
applyTomycustom.permssionIf set, this rule will only apply to those with this permission. Generally not used with exclude option.
excludemycustom.permissionif set, this rule will NOT apply to those with this permission. Generally not used in conjunction with the applyTo option.
groupsAllows you to apply (or exclude) players with groups or ranks (requires Vault plugin).
applyTo['newbs']Apply this rule with players with the Newbs rank
exclude['vips', 'vets']Do not apply this rule to players with these ranks/groups.

Factions integration options

You can use the following options when integrating with the Factions plugin


settingsub optionexamplenote
factions
appliesTo['BlueTeam', 'RedTeam']A list of faction names (case sensitive) that this rule applies to. Leave out to apply to all faction names
exclude['GreenTeam', 'YellowTeam']A list of faction names (case sensitive) that are excluded from this rule. Leave out to not exclude and factions. Generally not used with appliesTo setting
minPower5The minimum power level for this rule to apply to player Leave out for no minimum
maxPower10The max power level for user. Leave out to not have a max level.

McMMO integration Options


settingsub optionexamplenote
mcmmo
partytrueRequire player to be in a party to pass this rule
skills- herbalism: 5The minimum level of skill the player needs to have to pass the rule. You can have a list of 1 or more skills here

Examples


Example of a rule integrating with the Factions plugin that prevents

    BlueTeamOnly:
        description: 'use wooden pressure plates (requires Faction "BlueTeam")'
        messages:
            restricted: 'You must be in faction BlueTeam to %s %s. (type /f join BlueTeam)'
        factions:
            exclude: ['BlueTeam']
        actions: [USE, PLACE]
        items:
            restrict: [72]

Example of mcMMO integration


    Herbalism-1:
        description: 'use of iron hoes and melon seeds (requires "Herbalism" level 1)'
        actions: [USE, PLACE]
        messages:
            restricted: 'You must have herbalism level 1 to %s %s'
        mcmmo:
            skills:
                herbalism: 1
        items:
            restrict:
                [292, 362]

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

Facts

Date created
Jan 27, 2013
Last updated
Jan 27, 2013

Author