Date: 2022/12/05 13:13:06 UTC-08: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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
ventmarkercmd:
debug: false
type: command
name: ventmarker
description: Toggles the status of a block as a vent
usage: /ventmarker
script:
- if !<player.is_op>:
- narrate "<&c>No can do, my friend."
- stop
- if <player.has_flag[ventmarkerflag]>:
- flag <player> ventmarkerflag:!
- narrate "<&e>[D] <&f>Vent marker <&c>off"
- stop
- else:
- if <context.args.size> < 1:
- narrate "<&e>[D] <&7>(This needs an argument)"
- stop
- flag <player> ventmarkerflag:<context.args.get[1]>
- narrate "<&e>[D] <&f>Vent marker <&a>on<&f>, level <context.args.get[1]>"
- stop
ventmarkerpunch:
type: world
debug: false
events:
on player breaks block:
- if <player.has_flag[ventmarkerflag]>:
- determine cancelled passively
- if <context.location.has_flag[ventlevel]>:
- flag <context.location> ventlevel:!
- narrate "<&e>[D] <&c>Unlabeled <context.location.center.simple> as a vent!"
- stop
- flag <context.location> ventlevel:<player.flag[ventmarkerflag]>
- narrate "<&e>[D] <&a>Labeled <context.location.center.simple> as a vent, difficulty <player.flag[ventmarkerflag]>!"
ventopeninputitem1:
type: item
material: emerald_block
display name: <&a>Left click!
flags:
click: LEFT
ventopeninputitem2:
type: item
material: emerald_block
display name: <&c>Right click!
flags:
click: RIGHT
ventopeninputitem3:
type: item
material: emerald_block
display name: <&b>Drop!
flags:
click: DROP
ventopeninputitem4:
type: item
material: emerald_block
display name: <&d>Press <&f>4<&d>!
flags:
click: NUMBER4
ventopeninventory:
type: inventory
inventory: HOPPER
title: hoo
gui: true
definitions:
inputitem: ventopeninputitem<util.random.int[1].to[4]>
slots:
- [] [] [inputitem] [] []
ventmarkeropen:
type: world
debug: false
events:
on player right clicks block:
- if <context.location.has_flag[ventlevel]||false>:
- determine cancelled passively
- inventory open destination:ventopeninventory
- flag <player> ventdifficulty:<context.location.flag[ventlevel]>
- flag <player> ventprogress:0
- flag <player> theventinquestion:<context.location>
- define progressbar <element[<&b><element[█].repeat[<player.flag[ventprogress].round_up.max[0]>]><&1><element[▒].repeat[<element[20].sub[<player.flag[ventprogress].round_up.max[0]>]>]>]>
- inventory adjust lore:<list[<element[<[progressbar]>]>]> destination:<player.open_inventory> slot:3
on player closes ventopeninventory:
- flag <player> ventdifficulty:!
- flag <player> ventprogress:!
on player clicks item in ventopeninventory:
- stop if:!<context.item.has_flag[click]||false>
- ratelimit <player> 1t
- stop if:<player.has_flag[ventfailcooldown]>
- if <context.click||null> == NUMBER_KEY:
- if NUMBER<context.hotbar_button> == <context.item.flag[click]>:
- flag <player> ventprogress:+:1
- if <player.flag[ventprogress]> >= 20:
- flag <player> ventdifficulty:!
- inventory close
- define oldblock:<player.flag[theventinquestion].material>
- define oldblockloc:<player.flag[theventinquestion]>
- flag <player> theventinquestion:!
- modifyblock <[oldblockloc]> air
- wait 15s
- modifyblock <[oldblockloc]> <[oldblock]>
- stop
- wait 1t
- inventory set origin:ventopeninputitem<util.random.int[1].to[4]> destination:<player.open_inventory> slot:3
- define progressbar <element[<&b><element[█].repeat[<player.flag[ventprogress].round_up.max[0]>]><&1><element[▒].repeat[<element[20].sub[<player.flag[ventprogress].round_up.max[0]>]>]>]>
- inventory adjust lore:<list[<[progressbar]>]> slot:3
- playsound <player.location> <player> sound:item_spyglass_use pitch:<player.flag[ventprogress].div[14].min[2]>
- stop
- else:
- if <context.click||null> == <context.item.flag[click]>:
- flag <player> ventprogress:+:1
- if <player.flag[ventprogress]> >= 20:
- flag <player> ventdifficulty:!
- inventory close
- define oldblock:<player.flag[theventinquestion].material>
- define oldblockloc:<player.flag[theventinquestion]>
- modifyblock <[oldblockloc]> air
- flag <player> theventinquestion:!
- wait 15s
- modifyblock <[oldblockloc]> <[oldblock]>
- stop
- wait 1t
- inventory set origin:ventopeninputitem<util.random.int[1].to[4]> destination:<player.open_inventory> slot:3
- define progressbar <element[<&b><element[█].repeat[<player.flag[ventprogress].round_up.max[0]>]><&1><element[▒].repeat[<element[20].sub[<player.flag[ventprogress].round_up.max[0]>]>]>]>
- inventory adjust lore:<list[<[progressbar]>]> slot:3
- playsound <player.location> <player> sound:item_spyglass_use pitch:<player.flag[ventprogress].div[14].min[2]>
- stop
#- failed
- playsound <player.location> <server.online_players> sound:block_anvil_place
- flag <player> ventfailcooldown expire:50t
- if <player.flag[ventprogress]> < 0:
- flag <player> ventprogress:0
on tick every:2:
- foreach <server.online_players_flagged[ventdifficulty]>:
- if <[value].flag[ventprogress]> > 0:
- flag <[value]> ventprogress:-:<[value].flag[ventdifficulty].mul[2].div[28]||0>
- if <[value].flag[ventprogress]> < 0:
- flag <[value]> ventprogress:0
- if <[value].has_flag[ventfailcooldown]>:
- define progressbar <element[<&c><element[█].repeat[<[value].flag[ventprogress].round_up.max[0]>]><&4><element[▒].repeat[<element[20].sub[<[value].flag[ventprogress].round_up.max[0]>]>]>]>
- else:
- define progressbar <element[<&b><element[█].repeat[<[value].flag[ventprogress].round_up.max[0]>]><&1><element[▒].repeat[<element[20].sub[<[value].flag[ventprogress].round_up.max[0]>]>]>]>
- if <[value].open_inventory> != <[value].inventory>:
- inventory adjust lore:<list[<[progressbar]>]> destination:<[value].open_inventory> slot:3