Date: 2015/01/02 12:57:59 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
47
48
49
50
51
52
53
54
55
56
57
lantern1:
type: world
debug: true
events:
on player steps on block:
- if <player.location.light> <= 5 && <player.location.sub[0,0.1,0].material.is_solid||false> {
- if <player.item_in_hand> == i@torch || <player.has_flag[lanternon]> {
- showfake m@glowstone <context.previous_location.add[0,-1,0]> d:6t
- wait 1t
- if <c.new_location.simple> == <player.location.simple> {
- showfake m@glowstone <player.location.standing_on> d:5m
}
}
}
on player right clicks with i@fueledlantern:
- if <player.flag[lanternon]||false> {
- flag player fuelleft:<player.flag[lanternon].expiration>
- flag player lanternon:!
- showfake m@glowstone <player.location.add[0,-1,0]> d:6t
}
else if !<player.flag[fuelleft]||true> {
- flag player lanternon d:<player.flag[fuelleft]>
- flag player fuelleft:!
- showfake m@glowstone <player.location.add[0,-1,0]> d:5m
}
else {
- flag player lanternon d:5m
- showfake m@glowstone <player.location.add[0,-1,0]> d:5m
}
on player flag lanternon expires:
- showfake m@glowstone <player.location.add[0,-1,0]> d:6t
- take i@fueledlantern
- give i@lantern
lantern:
type: item
material: m@glass_bottle
display name: lantern
lore:
- this lantern needs fuel
lanternfuel:
type: item
material: m@potion,8236
display name: lantern_fuel
fueledlantern:
type: item
material: m@glass_bottle
display name: lantern
lore:
- right click to turn this lantern on
- right click again to turn it off
recipe:
- i@lanternfuel|i@air|i@air
- i@lantern|i@air|i@air
- i@air|i@air|i@air