Date: 2018/08/05 16:50:33 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
47
CheckBlock:
type: task
debug: true
script:
- if !<li@m@stone|m@cobblestone|m@andesite|m@polished_andesite|m@diorite|m@polished_diorite|m@granite|m@polished_granite|m@grass|m@dirt|m@coarse_dirt|m@podzol|m@mossy_cobblestone|m@mycel|m@ender_stone|m@netherrack|m@clay|m@stone_brick|m@mossy_stone_brick|m@cracked_stone_brick|m@chiseled_stone_bricks|m@end_bricks.contains[<player.location.add[0,-1,0].material>]> {
- queue clear
}
SummonBoulder:
type: world
debug: true
events:
on player starts sneaking:
- run CheckBlock
- if <player.flag[element]> == earth && <player.is_on_ground> {
- if <player.location.cursor_on[5].material> == m@air {
- if <player.has_flag[boulderpending]> {
- queue clear
}
- copyblock <player.location.add[0,-1,0]> to:<player.location.add[0,3,0]>
- flag player underblock:<player.location.add[0,-1,0].material.name>
- modifyblock <player.location.add[0,-1,0]> m@air
- flag player underblockloc:<player.location.add[0,-1,0]>
- flag player boulderpending:<player.location.add[0,3,0]>
- define boulderloc <player.location.add[0,3,0]>
- narrate "<&a>Flagged you with boulder pending"
- wait 5s
- if <player.has_flag[boulderpending]> {
- modifyblock <def[boulderloc]> m@air
- modifyblock <player.flag[underblockloc]> <player.flag[underblock]>
- flag player boulderpending:!
- flag player underblock:!
- narrate "<&a>No longer have boulderpending!"
}
}
}
on player left clicks:
- if <player.flag[element]> == earth && <player.has_flag[boulderpending]> {
#Modify the boulder to be a falling sand and launch it in direction player clicks
- define boulderloc <player.flag[boulderpending]>
- modifyblock <def[boulderloc]> m@air
- spawn falling_block,<player.flag[underblock]> <def[boulderloc]> save:boulder
- adjust <entry[boulder].spawned_entities.get[1]> "velocity:<player.location.direction.vector.mul[1.5]>"
- flag player boulderpending:!
- flag player underblock:!
- narrate "<&a>You no longer have boulder pending!"
}