Paste #121901: Unnamed Denizen Script Paste

Date: 2024/04/11 11:00:11 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


delight_world_event:
  type: world
  events:
    on player right clicks block:
    - if <context.item.contains[oraxen:id=string:cooking_pot]>:
      - flag <player.target> cooking_pot:true
      - note <inventory[delight_cooking_pot_inventory]> as:delight_cooking_pot_inventory_<player.target.uuid>
    on player right clicks entity:
    - if <context.entity.has_flag[cooking_pot]> && <context.entity.flag[cooking_pot]>:
      - define x <context.entity.location.below.material.item>
      - if <[x].contains[campfire]>:
        - adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<&lt>shift:-8<&gt><&lt>glyph:cookingpot_on<&gt>
        - inventory open destination:delight_cooking_pot_inventory_<context.entity.uuid>
      - else :
        - adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<&lt>shift:-8<&gt><&lt>glyph:cookingpot<&gt>
        - inventory open destination:delight_cooking_pot_inventory_<context.entity.uuid>
        - wait 5
        - adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<&lt>shift:-8<&gt><&lt>glyph:cookingpot_on<&gt>


delight_cooking_pot_inventory:
    type: inventory
    inventory: chest
    title: "<&lt>shift:-8<&gt><&lt>glyph:cookingpot<&gt>"
    gui: true
    slots:
    - [] [] [] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []

delight_cooking_pot_backend:
  type: world
  events:
      on player left clicks item in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
      - if not <context.is_shift_click>:
        - determine cancelled:false
      on player right clicks item in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
      - if not <context.is_shift_click>:
        - determine cancelled:false
      on player drags in delight_cooking_pot_inventory bukkit_priority:HIGH ignorecancelled:true:
      - if <context.slot> == 2|3|4|11|12|13:
        - determine cancelled:false
      on player left clicks in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
      - define identifiers oraxen:id=string:tomato|potato|cod|egg
      - define x 0
      - foreach <[identifiers]> key:key as:id :
        - if not <context.slot.contains[<[id]>]> && <context.cursor_item.contains[<[id]>]>:
          - define x:+:1
      - foreach <context.inventory.map_slots> key:key as:slot:
        - foreach <[identifiers]> key:key as:id :
          - if <[slot].contains[<[id]>]> && not <context.cursor_item.contains[air]>:
            - define x:+:1
      # - narrate "<[x]> <list[<[identifiers]>].size>""
      - if <list[<[identifiers]>].size> == <[x]>:
        - inventory set d:<context.inventory> o:apple slot:8
        - wait 1
        - inventory adjust d:<context.inventory> slot:2 quantity:<context.inventory.slot[2].quantity.sub[1]>
        - inventory adjust d:<context.inventory> slot:3 quantity:<context.inventory.slot[3].quantity.sub[1]>
        - inventory adjust d:<context.inventory> slot:4 quantity:<context.inventory.slot[4].quantity.sub[1]>
        - inventory adjust d:<context.inventory> slot:11 quantity:<context.inventory.slot[11].quantity.sub[1]>
        - inventory adjust d:<context.inventory> slot:12 quantity:<context.inventory.slot[12].quantity.sub[1]>
        - inventory adjust d:<context.inventory> slot:13 quantity:<context.inventory.slot[13].quantity.sub[1]>
        - narrate Done!!
      - narrate <context.item> targets:<server.online_players> per_player
      - narrate <context.slot> targets:<server.online_players> per_player
      - narrate <[x]> targets:<server.online_players> per_player