Attaches custom rules to specific items, pickup limits, no-PvP zones, no-drop protection, letting event organisers shape gameplay around key items.
ItemRules lets a server admin attach behavioural rules to whichever item they're currently holding. Rather than building gameplay restrictions into the world or into separate plugins, the rules travel with the item itself, pick the item up and the restrictions apply automatically.
Useful for events where a single artefact, scroll, or relic needs to behave differently from anything else: a "peace token" that disables PvP for whoever carries it, a "key" that can't be dropped or duplicated, or a quest item with a strict carry limit.
Rules are stored on the item's persistent data container, so they ride along with the stack, survive restarts, server transfers, /give snapshots, and shulker storage. Players in creative bypass all rules.
maxPickup caps how many of the item a player can hold across their entire setup, main inventory, hotbar, armour, offhand, and even the cursor stack are all counted. The pickup, hotbar-swap, double-click-collect, and shift-click paths are all guarded; partial stacks split correctly so the player gets up to the cap and the rest stays on the ground or in the chest.
noPvP takes a mode: hand blocks attacks only when the item is in the main hand, while inventory blocks attacks whenever the item is anywhere in the inventory. Both melee hits and player-fired arrows are covered.
noDrop blocks Q-drops and any inventory-click action that would move the item into a non-player inventory or out into the world.
Items can be tagged with rules without ever running an /itemrules add command. When a player picks up a dropped item, the plugin parses its display name; if it matches the four-field pipe format name|maxPickup|noPvP|noDrop, the rules are applied to the item's persistent data and the display name is rewritten to just name.
Field values:
maxPickup: a positive integer, or -1 for none.noPvP: inventory, hand, or false.noDrop: true or false.
This means a fully-configured artefact can be dispensed from a dispenser, dropped by a custom-named loot table, or spawned via /summon item: and as soon as a player picks it up, the rules attach and the name cleans up to just the leading segment. Useful for handing out themed items in bulk without needing to run /ir add on each one.
Also available under the alias /ir. Permission required: itemrules.admin.