Paste #28361: Untitled Paste

Date: 2016/01/13 05:42:16 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


test: 
  type: inventory 
  inventory: chest
  title: custom title 
  actions:
    on click:
    - determine cancelled passively
    - if <context.item> == i@barrier {
      - inventory close
      }
  size: 45 
  definitions: 
    border: i@black_stained_glass_pane
    return_button: i@barrier
  slots: 
    - "[border] [] [] [] [] [] [] [] [border]" 
    - "[border] [] [] [] [] [] [] [] [border]" 
    - "[border] [] [] [] [] [] [] [] [border]" 
    - "[border] [] [] [] [] [] [] [] [border]" 
    - "[border] [] [] [] [] [] [] [] [return_button]"
#
#
#
inventory_event_section:
  type: world
  debug: false
  events:
    on player clicks in inventory:
    - if <server.list_scripts.filter[container_type.is[==].to[inventory]].contains[<context.inventory.replace[in@].as_script||none>]> {
      - define script <context.inventory.replace[in@].as_script>
      - if "<def[script].yaml_key[actions].contains[on click]||false>" {
        - inject <def[script]> "path:actions.on click"
        }  
      }