Date: 2013/10/19 20:36:51 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
48
49
50
51
52
53
54
55
56
57
58
59
# Replacer tool
Replacer tool:
type: world
events:
on player right clicks with i@block replacer:
- if !<player.is_op> determine fulfilled
- if <player.is_sneaking> {
- narrate "Block replacer is currently set to '<player.flag[block_replacer_material] || m@stone>'."
} else {
- flag <player> block_replacer_material:<player.location.cursor_on.block.material>
- narrate "Block replacer material set to '<player.flag[block_replacer_material]>'."
}
- determine cancelled
on player left clicks with i@block replacer:
- if !<player.is_op> determine fulfilled
- if <player.is_sneaking> {
- modifyblock <player.flag[block_replacer_undo_location]> material:<player.flag[block_replacer_undo_material]>
- flag <player> block_replacer_undo_material[<player.flag[block_replacer_undo_material].size>]:<-
- flag <player> block_replacer_undo_location[<player.flag[block_replacer_undo_location].size>]:<-
- narrate 'Undone. <player.flag[block_replacer_undo_location].size> undos left.'
} else {
- flag <player> block_replacer_undo_material:->:<player.location.cursor_on.block.material>
- flag <player> block_replacer_undo_location:->:<player.location.cursor_on.simple>
- modifyblock '<player.location.cursor_on>' 'material:<player.flag[block_replacer_material] || m@stone>'
- if <player.flag[block_replacer_undo_material].size> > 30 {
- flag <player> block_replacer_undo_material[1]:<-
- flag <player> block_replacer_undo_location[1]:<-
}
}
- determine cancelled
on replacer command:
- if <c.raw_args> == 'reset' {
- flag <player> block_replacer_undo_material:!
- flag <player> block_replacer_undo_location:!
- flag <player> block_replacer_material:!
- narrate 'Reset flags for replacer tool.'
} else drop 'i@block replacer' <player.location>
- determine fulfilled
Block Replacer:
type: item
material: gold_spade
display name: <gold>Block Replacer
lore:
- <light_purple>Easily replace blocks!
- <white>-------------------------------
- <yellow>right click a block to set the material
- <yellow>shift-right click to see the current material
- <yellow>left click a block to replace
- <yellow>shift-left click to undo the replacement