Paste #112117: Crusher

Date: 2023/07/10 06:54:51 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


crusher_inventory:
    type: inventory
    inventory: chest
    title: Crusher inventory
    debug: true
    gui: true
    size: 27
    slots:
    - [] [] [] [] [] [] [] [] []
    - [] [] [GRAVEL_PLACE] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []
GRAVEL_PLACE:
    type: item
    debug: false
    material: paper
    mechanisms:
        custom_model_data: 20011
    display name: <&r><&6>Crusher
    lore:
        - <&r><&7>Place Gravel to crush

crusher_gui_handler:
    type: world
    debug: true
    events:
        after player left clicks slot:12 in crusher_inventory with:gravel:
        - stop if:<context.clicked_inventory.equals[<player.inventory>]>
        - define item <player.item_on_cursor>
        - define material <[item].material.name>
        - if <[material].advanced_matches[gravel]>:
            - inventory set o:<player.item_on_cursor> d:<context.clicked_inventory> slot:12
            - take cursoritem
        after player clicks gravel in crusher_inventory:
        - stop if:<context.clicked_inventory.equals[<player.inventory>]>
        - if <context.inventory.slot[12].advanced_matches[gravel]> && <player.item_on_cursor.material.name.equals[air]>:
            - give <context.item>
            - inventory set o:GRAVEL_PLACE d:<context.clicked_inventory> slot:12

crusher_open:
    type: command
    name: mtest
    debug: false
    description: Crusher
    usage: /mtest
    script:
        - inventory open destination:crusher_inventory