Drag&Drop books onto Player Heads
Steps to Enable Drag & Drop for PLAYER_HEAD
To allow custom enchantment books to be applied onto PLAYER_HEAD items through a drag-and-drop action, you need to modify the enchantments.yml file. Here's how to do it:
1. Locate the Enchantment Entry: Find the specific enchantment entry in the
enchantments.ymlfile. This file contains all the custom enchantments available on your server.2. Modify the 'Applies' Section: In the enchantment entry, look for the
appliessection. This section determines which items the enchantment can be applied to.3. Add PLAYER_HEAD to the Applies Section: Under the
appliessection, add- PLAYER_HEADto allow the enchantment to be applied to PLAYER_HEAD items.Here's an example for the
glowingenchantment:
glowing:
  display: '%group-color%Glowing'
  description: Gives permanent night vision.
  applies-to: Helmet
  type: EFFECT_STATIC
  group: SIMPLE
  applies:
    - ALL_HELMET
    - PLAYER_HEAD
  levels:
    '1':
      effects:
        - POTION:NIGHT_VISION:04. Save Changes and Reload: After making the changes, save the
enchantments.ymlfile. Then, reload the plugin configurations on your server to apply the changes.
Last updated
Was this helpful?