Date: 2016/12/14 10:31:01 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
ambienlight:
type: command
name: ambientlight
usage: /ambientlight
script:
- if <player.has_flag[ambientlightoff]> {
- light <context.previous_location> reset
- flag player ambientlightoff:!
- narrate "<&o>Ambient Lighting has been Enabled. Use this command again to disable Ambient Lighting.<&r>"
- queue clear
}
- flag player ambientlightoff
- narrate "<&o>Ambient Lighting has been Disabled. Use this command again to Enable Ambient Lighting.<&r>"
ambient:
type: world
debug: false
events:
on player steps on block:
- if <player.has_flag[ambientlight]> {
- light <context.previous_location> reset
- flag player ambientlight:!
}
- if <player.has_flag[ambientlightoff]> {
- queue clear
}
- if <player.item_in_hand.material.name> == torch || <player.item_in_offhand.material.name> == torch {
- light <context.location.add[0,1,0]> 10
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == glowstone || <player.item_in_offhand.material.name> == glowstone {
- light <context.location.add[0,1,0]> 14
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == sea_lantern || <player.item_in_offhand.material.name> == sea_lantern {
- light <context.location.add[0,1,0]> 14
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == redstone_torch_on || <player.item_in_offhand.material.name> == redstone_torch_on {
- light <context.location.add[0,1,0]> 7
- flag player ambientlight
}
on player quits:
- if <player.has_flag[ambientlight]> {
- light <context.previous_location> reset
- flag player ambientlight:!
}