Paste #92372: Unnamed Denizen Script Paste

Date: 2022/01/18 23:39:01 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Nullorb:
    type: item
    material: emerald
    display name: <&d><&l>Null Orb
    mechanisms:
      custom_model_data: 106
    lore:
    - <&d><&l>Fabled <&r><&d>Consumable
    - <&8><&m>⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯<&r>
    - <&7>Capable of wiping enchantments from an item.
    - <&7>Click on an enchanted item to delete its enchantments.
    - <&c>Careful, this cannot be reverted!

nullorb_handler:
    type: world
    debug: false
    events:
        on player clicks in inventory with:nullorb:
        - ratelimit <player> 5t
        - if <context.item.material.name> != air:
          - if <context.item.is_enchanted>:
            - determine passively cancelled
            - inventory adjust remove_enchantments slot:<context.slot> 
            - take cursoritem quantity:1
            - playsound <player> sound:BLOCK_ANVIL_STEP

            - define lore <context.item.lore>
            - foreach lore
                - if <context.item.lore.starts_with[<[].strip_color>]>
                - adjust <context.item.lore>

            - wait 1t
            - inventory update
        - else:
          - narrate "<&c>Can only be used on an enchanted item."
          - playsound <player> sound:BLOCK_NOTE_BLOCK_BASS pitch:0.1
          - wait 1t
          - inventory update