Item Restriction
PluginMIT

Item Restriction

Allow/Disallow Every Item in the Game! All ingame in a GUI!

106
Downloads
0
Followers
1 months ago
Updated
📦
7
Versions

📖About Item Restriction

RestrictionsPlugin

A comprehensive, fully configurable restriction system for Paper 1.21.11 servers.

Ban items, limit stack sizes, cap durability, block enchants, control crafting and dropping — all from an in-game GUI or via commands, with no restart required.


✦ Features

Global Mechanic Restrictions

Individually toggleable rules that target specific vanilla mechanics known to cause balance or exploit issues on SMP servers:

Restriction What it does
Totem of Undying Totems never drop anywhere. If a player somehow obtains one it is immediately removed from their inventory.
End Crystal & Respawn Anchor Cannot be crafted, picked up, placed, or moved through hoppers. Existing anchors drop nothing when broken.
Mace Cannot be obtained or crafted. Does no damage.
Elytra Cannot be picked up, worn, or used to glide.
Potions Bans Strength II, Speed II, Turtle Master I & II in all forms (regular, splash, lingering). Brewing is blocked.
TNT Minecart Maximum 2 per chunk. Cannot be ignited by fire, flame enchanted arrows, fire charges, lava, or any other combustion source.
TNT Duper Fix Pistons cannot push or pull TNT blocks, eliminating the most common duplication exploits.
Mending Trades Regular villagers cannot offer or learn Mending book trades. Existing trades are stripped on GUI open.
Banned Enchantments Breach, Density, and Punch II are stripped from all items globally.
Trident Capped at 100 durability. Cannot receive Mending.
Iron Farm Village-spawned Iron Golems are completely blocked. Manually built golems (4 iron blocks + carved pumpkin) are unaffected.

Per-Item Restriction System

Every single Minecraft item can be individually configured with any combination of:

  • 🚫 Banned — completely removes from inventory, prevents pickup, crafting, placing, and dropping
  • 📦 Max Stack Size — cap stacks at any value from 1 to 64
  • ⚒️ Max Durability — cap remaining durability (e.g. limit a sword to 100 uses)
  • 🔨 Banned in Crafting — block as crafting ingredient or result
  • 🧱 Banned Placing — prevent placing as a block
  • 🗑️ Banned Dropping — block Q-key drops and death drops
  • Per-item Enchant Bans — strip specific enchantments from a specific item only
  • 🏷️ Force Display Name — override the item name with color code support
  • 📜 Force Lore — inject custom lore lines onto all instances of the item

All changes are saved to items.yml and take effect immediately without a server restart.


In-Game GUI

Open with /itemgui — no commands to memorize.

Item Browser — paginated list of all Minecraft items, configured items shown first with a green enchant glow and a rule summary in the tooltip.

Item Editor — click any item to open its full editor:

  • Toggle switches for banned, no-crafting, no-placing, no-dropping
  • Left/right-click to raise or lower max stack and max durability; shift for ×10 steps; middle-click to reset
  • Enchant ban preview with click-to-remove buttons
  • Force name and lore editing via in-chat input

Enchant Picker — paginated list of all ~40 enchantments. Click to ban or unban for the specific item. Green = currently banned, grey = allowed.


📋 Requirements

  • Paper 1.21.11 (or any 1.21.x build)
  • Java 17+
  • No dependencies

⚙️ Installation

  1. Download RestrictionsPlugin
  2. Place it in your server's plugins/ folder
  3. Start or restart the server
  4. Two config files are created automatically:
    • plugins/RestrictionsPlugin/config.yml — global restriction toggles
    • plugins/RestrictionsPlugin/items.yml — per-item rules

🔑 Permissions

Permission Default Description
restrictions.admin OP Access to all commands and the GUI

💬 Commands

/restrict — Global Mechanic Toggles

Requires restrictions.admin

Command Description
/restrict Show all restrictions with their current on/off status
/restrict list Same as above
/restrict toggle <key> Toggle a restriction on or off
/restrict enable <key> Enable a restriction
/restrict disable <key> Disable a restriction
/restrict enableall Enable every restriction at once
/restrict disableall Disable every restriction at once
/restrict reload Reload config.yml from disk

Available keys:

Key Restriction
totem Totem of Undying
crystal_anchor End Crystal & Respawn Anchor
mace Mace
elytra Elytra
potions Strength II / Speed II / Turtle Master potions
tnt_minecart TNT Minecart chunk limit & fire immunity
tnt_duper TNT Duper Fix (piston + TNT)
mending_trade Mending villager trades
enchantments Breach, Density, Punch II global ban
trident Trident durability cap & no Mending
iron_farm Automatic Iron Golem farm prevention

Examples:

/restrict toggle elytra
/restrict disable tnt_minecart
/restrict enable totem
/restrict disableall

/itemgui — Item Restriction GUI

Requires restrictions.admin · Player only

Opens the full in-game GUI for browsing and editing per-item restrictions.

/itemgui

Use the GUI to configure any item visually. All changes save automatically.


/itemrestrict — Per-Item Restrictions (Command Interface)

Requires restrictions.admin

All commands support hand as the item argument — targets whatever you are currently holding.


/itemrestrict list
Show all items that have at least one active rule, with a summary of each.


/itemrestrict info <item|hand>
Show a detailed breakdown of every rule configured for a specific item.

/itemrestrict info DIAMOND_SWORD
/itemrestrict info hand

/itemrestrict set <item|hand> banned <true|false>
Completely ban an item. Players who obtain it will have it silently removed.

/itemrestrict set ENCHANTED_GOLDEN_APPLE banned true
/itemrestrict set hand banned true

/itemrestrict set <item|hand> max_stack <1-64>
Set the maximum stack size. Use -1 to reset to vanilla default.

/itemrestrict set GOLDEN_APPLE max_stack 16
/itemrestrict set TNT max_stack 8
/itemrestrict set GOLDEN_APPLE max_stack -1

/itemrestrict set <item|hand> max_durability <number>
Cap the maximum remaining durability of an item. Use -1 to reset.

/itemrestrict set DIAMOND_SWORD max_durability 500
/itemrestrict set hand max_durability 100
/itemrestrict set DIAMOND_SWORD max_durability -1

/itemrestrict set <item|hand> banned_in_crafting <true|false>
Prevent the item from being used as a crafting ingredient or appearing as a crafting result.

/itemrestrict set TNT banned_in_crafting true

/itemrestrict set <item|hand> banned_placing <true|false>
Prevent the item from being placed as a block.

/itemrestrict set RESPAWN_ANCHOR banned_placing true

/itemrestrict set <item|hand> banned_dropping <true|false>
Prevent the item from being dropped with Q and from appearing in death drops.

/itemrestrict set NETHERITE_INGOT banned_dropping true

/itemrestrict set <item|hand> banned_enchants add <enchant>
Ban a specific enchantment from a specific item. The enchantment will be stripped whenever the item is in a player's inventory.

/itemrestrict set DIAMOND_SWORD banned_enchants add sharpness
/itemrestrict set BOW banned_enchants add power

/itemrestrict set <item|hand> banned_enchants remove <enchant>
Remove a specific enchantment ban from an item.

/itemrestrict set DIAMOND_SWORD banned_enchants remove sharpness

/itemrestrict set <item|hand> banned_enchants clear
Remove all enchantment bans for an item.

/itemrestrict set DIAMOND_SWORD banned_enchants clear

/itemrestrict set <item|hand> force_name <name>
Force a display name on all instances of this item. Use & for color codes. Use clear to remove.

/itemrestrict set GOLDEN_SWORD force_name &6&lThe Golden Blade
/itemrestrict set GOLDEN_SWORD force_name clear

/itemrestrict set <item|hand> force_lore add <text>
Add a forced lore line to an item. Use & for color codes. Lines are appended in order.

/itemrestrict set DIAMOND_SWORD force_lore add &7Server restricted item
/itemrestrict set DIAMOND_SWORD force_lore add &cHandle with care

/itemrestrict set <item|hand> force_lore remove <index>
Remove a specific lore line by its index (0-based).

/itemrestrict set DIAMOND_SWORD force_lore remove 0

/itemrestrict set <item|hand> force_lore clear
Remove all forced lore lines from an item.

/itemrestrict set DIAMOND_SWORD force_lore clear

/itemrestrict clear <item|hand>
Remove every rule configured for an item, restoring it to completely unrestricted.

/itemrestrict clear DIAMOND_SWORD
/itemrestrict clear hand

/itemrestrict reload
Reload items.yml from disk. Useful if you edited the file manually.

/itemrestrict reload

📁 Configuration Files

config.yml

Controls the global mechanic restrictions. All values default to true (enabled).

restrictions:
  totem: true
  crystal_anchor: true
  mace: true
  elytra: true
  potions: true
  tnt_minecart: true
  tnt_duper: true
  mending_trade: true
  enchantments: true
  trident: true
  iron_farm: true

items.yml

Per-item rules. Edit manually or use /itemrestrict and /itemgui in-game.

items:
  ENCHANTED_GOLDEN_APPLE:
    banned: true

  GOLDEN_APPLE:
    max_stack: 16
    banned_in_crafting: false

  DIAMOND_SWORD:
    max_stack: 1
    max_durability: 500
    banned_enchants:
      - sharpness
      - fire_aspect
    force_name: "&b&lDiamond Sword"
    force_lore:
      - "&7Server restricted item"

  TNT:
    banned_placing: false
    banned_in_crafting: true
    max_stack: 16

📝 Notes

  • All /itemrestrict and /itemgui changes save automatically to items.yml and take effect immediately without a restart.
  • items.yml is written to disk in the background every 30 seconds when changes are pending, to avoid per-click disk I/O.
  • The hand shortcut in /itemrestrict targets the item you are holding at the time of the command.
  • Enchantment names use Minecraft's internal keys (lowercase with underscores), e.g. sharpness, fire_aspect, swift_sneak.
  • Color codes use the & prefix: &a = green, &c = red, &l = bold, etc.
  • The iron farm restriction only blocks village-mechanic spawns. Players can still build golems manually with 4 iron blocks and a carved pumpkin.