# #️⃣Set Slot

Set slot represents writing a special NBT to the player's item to record how many enchanted slots the item currently has. You can set when to execute set slots through `set-slots-trigger` section at `config.yml` file.

```yaml
  # This is when will the plugin trying adds enchantment slot NBT for an enchantable item which also means set fixed
  # enchantment slot for an item.
  set-slot-trigger:
    add-hide-enchant-flag: false
    black-book: true
    # This option support ProtocolLib only.
    # Enable this maybe improve plugin performance.
    SetSlotPacket:
      enabled: true
      # Only plugin has enchantment slot NBT will be checked.
      remove-illegal-excess-enchant: true
    EnchantItemEvent:
      enabled: true
      # Whether cancel the enchantment event or remove extra enchantment if
      # item reached slot limit after enchant.
      cancel-if-reached-slot: false
    AnvilItemEvent:
      enabled: true
      # If your item has display issue after use anvil, you can try to enable this.
      update-item: false
    SmithItemEvent:
      enabled: true
      # If set to true, we will reset old item enchantment slot and then regenerate new slot
      # value for new item, enchantments won't affect by this option.
      reset-previous-slot: true
      # If set to true, if new generated slot value smaller than existed slot value, we will still
      #      # keep use existed value as new upgraded item's slot limit.
      keep-greater-slot: true
    # Enable this maybe improve plugin performance.
    # Maybe has incompatible issue with other plugins.
    InventoryClickEvent:
      enabled: true
```

[Enchantable items](/for-4.1.8/auto-add-lore/item-can-be-enchanted.md) without **set slots** will automatically calculate their enchanting slots through `default-slots` in the configuration file. This process consumes a lot of server performance, but the result is that the enchantment slots for the item are not **fixed**, which means that when player A drops the item to player B, the number of enchantment slots will change depending on the [conditions met](/for-4.1.8/enchantment-slot/default-slot-max-slot.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enchantmentslots.superiormc.cn/for-4.1.8/enchantment-slot/set-slot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
