Date: 2023/07/09 23:40:40 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
machine_inventory:
type: inventory
inventory: chest
title: Machine inventory
debug: true
gui: true
size: 27
slots:
- [] [] [] [] [] [] [] [] []
- [] [] [SHOVEL_PLACE] [] [] [] [] [] []
- [] [] [] [] [] [] [] [] []
SHOVEL_PLACE:
type: item
debug: false
material: paper
mechanisms:
custom_model_data: 20011
display name: <&r><&6>Digger
lore:
- <&r><&7>Place a shovel to dig automatically
machine_gui_handler:
type: world
debug: true
events:
after player right clicks slot:12 in machine_inventory with:wooden_shovel:
- stop if:<context.clicked_inventory.equals[<player.inventory>]>
- define item <player.item_on_cursor>
- define material <[item].material.name>
- if <[material].advanced_matches[wooden_shovel]>:
- take cursoritem
- inventory set o:<player.item_on_cursor> d:<context.clicked_inventory> slot:12
after player clicks wooden_shovel in machine_inventory:
- stop if:<context.clicked_inventory.equals[<player.inventory>]>
- if <context.inventory.slot[12].advanced_matches[wooden_shovel]> && <player.item_on_cursor.material.name.equals[air]>:
- give <context.item>
- inventory set o:SHOVEL_PLACE d:<context.clicked_inventory> slot:12
machine_open:
type: command
name: mtest
debug: false
description: Deposit digger
usage: /mtest
script:
- inventory open destination:machine_inventory