Date: 2014/04/04 21:29:58 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
lumihomecommands:
type: world
debug: true
events:
on lumihome command:
- inject locally path:lumihomecommandhandler
on lh command:
- inject locally path:lumihomecommandhandler
lumihomecommandhandler:
- determine fulfilled passively
- if <context.args.get[1]> == add inject locally path:lumihomeadd
- if <context.args.get[1]> == delete inject locally path:lumihomedelete
- if <context.args.get[1]> == remove inject locally path:lumihomedelete
- if <context.args.get[1]> == list inject locally path:lumihomelist
- if <context.args.get[1]> == help inject locally path:lumihomehelp
- if <context.args.get[1]> == teleport inject locally path:lumihomeinitiateteleport
- if <yaml[lumihomesaves].list_keys[lumihomes.<player.name>]> contains <context.args.get[1]> inject locally path:lumihomeinitiateteleport
lumihomeadd:
- if <player.has_permission[lumihome.unlimited]> {
- if <context.args.get[2]||empty> == empty {
- narrate "<&c>Please specify a name for your home!"
- queue clear
}
- inject locally path:lumihomeaddinitiate
} else if <player.has_permission[lumihome.add]> {
- if <yaml[lumihomesaves].list_keys[lumihomes.<player.name>].size> < 5 {
- if <context.args.get[2]||empty> == empty {
- narrate "<&c>Please specify a name for your home!"
- queue clear
}
- inject locally path:lumihomeaddinitiate
} else {
- narrate "<&c>You can't have more than 5 homes as a guest!"
}
} else {
- narrate "<&c>You do not have the permission to do this!"
}
lumihomeaddinitiate:
- if <yaml[lumihomesaves].list_keys[lumihomes.<player.name>]> !contains <context.args.get[2]> {
- narrate "<&6>You added a home."
- yaml id:lumihomesaves set lumihomes.<player.name>.<context.args.get[2]>.location:<player.location>
} else {
- narrate "<&c>You already have a home with this name!"
}
lumihomedelete:
- if <player.has_permission[lumihome.delete]> {
- if <context.args.get[2]||empty> == empty {
- narrate "<&c>Please specify a name for your home!"
- queue clear
}
- if <yaml[lumihomesaves].list_keys[lumihomes.<player.name>]> contains <context.args.get[2]> {
- narrate "<&6>You deleted a home."
- yaml id:lumihomesaves set lumihomes.TheBlackCoyote.<context.args.get[2]>:!
} else {
- narrate "<&c>You don't have a home with this name yet!"
}
} else {
- narrate "<&c>You do not have the permission to do this!"
}
lumihomelist:
- if <player.has_permission[lumihome.list]> {
- narrate "<&6>Your homes: <yaml[lumihomesaves].list_keys[lumihomes.<player.name>].formatted||none>."
}
lumihomehelp:
- narrate "notyetpls"
lumihomeinitiateteleport:
- if <player.has_permission[lumihome.teleport]> {
- if <context.args.get[1]> == teleport {
- define destination <context.args.get[2]>
} else {
- define destination <context.args.get[1]>
}
- inject locally path:lumihometeleport
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumihometeleport:
- if <def[destination]||empty> == empty {
- narrate "<&c>Please specify a valid home to teleport to!"
- queue clear
}
- narrate "<&6>You teleported to your %destination% home."
- teleport <yaml[lumihomesaves].read[lumihomes.<player.name>.%destination%.location]>