pluginiPlugin

Item Lock Mechanism

How to Lock and Update Existing Items

What is the Lock Mechanism

The lock mechanism allows server administrators to force updates to the configuration of existing items. When you add the !! suffix to a configuration item, all existing instances of that item owned by players will be immediately updated to the new configuration values after reloading the configuration.

Config Items Supporting Locking

1. Material Locking

my_sword:
  # Lock the material; all existing items will become diamond swords after reloading
  icon!!: diamond_sword

2. Name Locking

my_sword:
  name!!:  # Lock name variables
    item_name: '&6New Name'
    item_title: '&lUpdated Title'

3. Lore Locking

my_sword:
  lore!!:  # Lock lore variables
    item_type: '&9Weapon'
    item_description:
      - '&fUpdated Description'

4. Data Field Locking

my_sword:
  data:
    damage!!: 50     # Lock damage value
    level!!: 10      # Lock level
    speed: 1.5       # Not locked; existing items retain their original values

5. Event Locking

my_sword:
  event:
    on_right_click!!:  # Lock right-click event
      - "tell 'Updated Event!'"

Practical Usage Scenarios

Balance Adjustment

# A certain weapon is too powerful and needs to be weakened
op_sword:
  data:
    damage!!: 30  # Reduced from 100 to 30; takes effect immediately for all existing items

Bug Fixing

# Fix item name typo
typo_item:
  name!!:
    item_name: '&6Correct Name'  # Fix spelling error

Uniform Appearance

# Standardize the appearance of all items of the same type
magic_wand:
  lore!!:
    item_type: '&dMagical Item'  # Standardize category display

Important Notes

  1. Use with Caution: Locking will overwrite players' personalized items
  2. Test First: Verify the effect on a test server
  3. Root-Level Not Supported: You cannot write data!!:; only specific fields can be locked
  4. Takes Effect Immediately: All existing items are updated immediately after using /zaphkiel reload

Common Mistakes

# ❌ Incorrect syntax
my_item:
  data!!:           # This syntax is not supported
    damage: 100
 
# ✅ Correct syntax
my_item:
  data:
    damage!!: 100   # Lock specific fields

On this page