Date: 2016/03/21 16:05:05 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
##############################################
## Block Protection & Resource Harvesting ##
##############################################
Player_Breaks:
type: world
debug: false
resources:
- gold_ore
- iron_ore
- coal_ore
- lapis_ore
- diamond_ore
- redstone_ore
- emerald_ore
- quartz_ore
events:
on player changes soil into dirt:
- determine cancelled
on player breaks block:
- if <pl.flag[owner]> determine fulfilled
- if <script.yaml_key[resources].contains[<context.location.material.name>].not> {
- narrate "<&c>You cannot break this."
- determine cancelled
}
- choose <context.location.material.name>:
- case gold_ore:
- if <pl.flag[miner].is[MORE].than[2]> {
- define harvest "<util.random.int[1].to[3]>"
- narrate "<&a>You have successfully harvested <&6>%harvest% <&a>gold ore."
- give gold_ore quantity:%harvest%
- narrate "<&e>This resource will respawn in 15 minutes."
# COUNTDOWN AND RESPAWN HERE
} else {
- narrate "<&c>You must have a mining level of 3 or higher to harvest this."
- determine cancelled
}
- case iron_ore:
- case coal_ore:
- case lapis_ore:
- case diamond_ore:
- case redstone_ore:
- case emerald_ore:
- case quartz_ore: