Paste #52494: Untitled Paste

Date: 2019/02/17 07:49:28 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CharacterSheetHandler:
  type: world
  events:
#Skills Inventories#
    on player clicks in SkillsInv:
    - determine passively cancelled
    - if <context.item.has_nbt[Skill]>:
      - if <context.click> == left:      
        - inventory close
        - execute as_player "skill <context.item.nbt[Skill]>"
        - queue clear
    - if <context.click> == right:
 ##Shift Click##    
     - if <context.is_shift_click>:
      - if <player.item_in_hand.has_nbt[Skill]>:
        - narrate "<player.item_in_hand.nbt[Skill]> unbound."
        - define Slot <player.item_in_hand.slot>
        - take <player.item_in_hand>
        - adjust <context.item> "lore:<&6>Bound Skill<&co><&9> <context.item.nbt[Skill]>|<&c><&o>Right Click<&r> to use the bound skill!]>" save:newitem
        - adjust <entry[new_item].result> "display_name:Skill<&co><&6> <context.item.nbt[Skill]>" save:newitem
        - give <entry[newitem].result> slot:<player.item_in_hand.slot>
        - narrate "<context.item.nbt[Skill]> bound to slot <def[Slot]>. Equip the item and right click to use the skill."
        - queue clear
      - if <player.inventory.first_empty> < 10:
        - adjust <context.item> "lore:<&6>Bound Skill<&co><&9> <context.item.nbt[Skill]>|<&c><&o>Right Click<&r> to use the bound skill!]>" save:newitem
        - adjust <entry[new_item].result> "display_name:Skill<&co><&6> <context.item.nbt[Skill]>" save:newitem
        - give <entry[newitem].result> slot:<player.inventory.first_empty>
        - queue clear
      - else:
        - narrate "You must have an <&c>EMPTY<&r> Quick Bar slot to bind a skill to a slot. Alternatively you may replace a previously bound slot by holding it and using the Skills menu again."
        - queue clear