-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpleefShovels.dsc
102 lines (94 loc) · 3.35 KB
/
SpleefShovels.dsc
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
spleef_shovels_config:
type: data
spleef_block: snow_block
spleef_explosive_shovel:
type: item
debug: false
material: golden_shovel
display name: <red><bold>Spleef Explosive Shovel
mechanisms:
unbreakable: true
spleef_shovels_explosive_shovel_handler:
type: world
debug: false
events:
after player breaks block with:spleef_explosive_shovel:
- define spleefBlock <script[spleef_shovels_config].data_key[spleef_block]>
- if <context.material.name> != <[spleefBlock]>:
- stop
- ratelimit <player> 1s
- modifyblock <context.location.find_blocks[<[spleefBlock]>].within[1.5]> air source:<player>
- playeffect effect:explosion_large at:<context.location.above> offset:0,0,0
spleef_tunnel_shovel:
type: item
debug: false
material: stone_shovel
display name: <gray><italic>Spleef Tunnel Shovel
mechanisms:
unbreakable: true
spleef_shovels_tunnel_shovel_handler:
type: world
debug: false
events:
after player right clicks block with:spleef_tunnel_shovel:
- ratelimit <player> 1s
- define target <player.cursor_on[15]>
- define spleefBlock <script[spleef_shovels_config].data_key[spleef_block]>
- if <[target].material.name> != <[spleefBlock]>:
- stop
- define start <player.location.below>
- if <[start].y> != <[target].y>:
- stop
- define path <[start].above.points_between[<[target].above>].distance[0.2]>
- foreach <[path]> as:point:
- playeffect effect:block_crack at:<[point]> offset:0,0,0 quantity:10 special_data:stone
- wait 1t
- define toAdd <[target].find_blocks[<[spleefBlock]>].within[1]>
- while <[toAdd].count_matches[<[spleefBlock]>]> != 0:
- define blocks:|:<[toAdd].filter[material.name.equals[<[spleefBlock]>]]>
- define target <[target].below[2]>
- define toAdd <[target].find_blocks.within[1]>
- modifyblock <[blocks]> air source:<player>
- playeffect effect:cloud at:<[blocks].parse[center]> quantity:20 offset:0.5,0.5,0.5
spleef_build_shovel:
type: item
debug: false
material: diamond_shovel
display name: <aqua><bold>Spleef Build Shovel
mechanisms:
unbreakable: true
spleef_shovels_build_shovel_handler:
type: world
debug: false
events:
after player right clicks block with:spleef_build_shovel type:!air|cave_air:
- define spleefBlock <script[spleef_shovels_config].data_key[spleef_block]>
- if <context.location.material.name> != <[spleefBlock]>:
- stop
- define top <context.location.above>
- if <[top]> !matches air|cave_air:
- stop
- define bottom <context.location>
- while <[bottom].material.name> == <[spleefBlock]>:
- define bottom <[bottom].below>
- define bottom <[bottom].above>
- modifyblock <[top]> <context.location.material> source:<player>
- modifyblock <[bottom]> air source:<player>
spleef_shovels_generic_handler:
type: world
debug: false
events:
on player breaks block with:spleef_*_shovel:
- determine cancelled if:!<context.material.name.equals[<script[spleef_shovels_config].data_key[spleef_block]>]>
spleef_shovles_command:
type: command
debug: false
name: spleefshovels
description: Give yourself spleef shovels
usage: /spleefshovels
permission: spleefshovels.use
script:
- if <context.source_type> == PLAYER:
- give spleef_explosive_shovel
- give spleef_tunnel_shovel
- give spleef_tunnel_shovel