Date: 2017/11/10 22:05:36 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Mount_Command:
debug: false
type: command
name: mount
description: Summon a custom mount!
usage: /mount
tab complete:
- define Allowed li@wither_skeleton|stray|zombie_villager|skeleton_horse|zombie_horse|donkey|mule|minecart|creeper|skeleton|spider|giant|zombie|slime|zombie_pigman|enderman|cave_spider|sliverfish|blaze|magma_cube|bat|witch|endermite|pig|sheep|cow|chicken|wolf|mooshroom|snowman|ocelot|iron_golem|horse|rabbit|polar_bear|Llama|villager|player|parrot|ghast|boat|armor_stand
- define HSC '<c.raw_args.to_list.count[ ]||0>'
- if <c.args.get[1].is[==].to[name]> queue clear
- if <def[HSC].is[==].to[0]> && <c.args.get[1]> != null {
- determine <li@Name|Type.filter[starts_with[<c.args.get[1]>]]>
}
- if <def[HSC].is[==].to[0]> && <c.args.get[1]> == null {
- determine Name|Type
}
- if <def[HSC].is[==].to[1]> && <c.args.get[2]> != null {
- determine <def[Allowed].filter[starts_with[<c.args.get[2]>]]>
}
- if <def[HSC].is[==].to[1]> && <c.args.get[1]> != null {
- determine <def[Allowed]>
}
aliases:
- m
script:
- if <player.world.is[==].to[w@dungeons].not> {
- narrate "<red>You don't have permission to use this command!"
- queue clear
}
- define Allowed li@wither_skeleton|stray|zombie_villager|skeleton_horse|zombie_horse|donkey|mule|minecart|creeper|skeleton|spider|giant|zombie|slime|zombie_pigman|enderman|cave_spider|sliverfish|blaze|magma_cube|bat|witch|endermite|pig|sheep|cow|chicken|wolf|mooshroom|snowman|ocelot|iron_golem|horse|rabbit|polar_bear|Llama|villager|player|parrot|ghast|boat|armor_stand
- if <player.has_flag[MountCreated].not> {
- create player <player.name> save:NPC
- flag player MountCreated:true
- flag player Mount:<entry[NPC].created_npc>
- flag <entry[NPC].created_npc> mount:true
- narrate "<Gold>You seem to not have a mount! Creating one for you, please wait..."
- execute as_server "npc select <player.flag[Mount].after[n@]>"
- execute as_server "npc controllable"
- execute as_server "npc speed 7"
- adjust <player.flag[Mount]> set_entity_type:player
- wait 2s
- narrate "<Gold>Mount created!"
- wait 15t
- narrate "<gold>Usage:<white> /mount (name/type)"
- queue clear
}
- choose <context.args.get[1]||null>:
- case name:
- if <c.args.get[2]||true> {
- narrate "<gold>Usage:<white> /mount name <<>Name<>>"
- queue clear
}
- if <c.args.get[2]> == "1_9" {
- narrate "<red>Invalid name!"
- queue clear
}
- if <c.args.size> >= 3 {
- define Name li@
- foreach <c.args.exclude[<c.args.get[1]>]> {
- define Name <def[Name].include[<def[value]>]>
}
- adjust <player.flag[Mount]> name:<def[name].space_separated.parse_colors>
- narrate "<Gold>Set your mount's name to <red><def[name].space_separated.parse_colors><gold>!"
- queue clear
}
- adjust <player.flag[Mount]> name:<c.args.get[2].parse_colors>
- narrate "<Gold>Renamed your mount to <red><c.args.get[2].parse_colors><gold>!"
- case type:
- if <c.args.get[2]||true> {
- narrate "<gold>Usage:<white> /mount type <<>type<>>"
- queue clear
}
- if <def[Allowed].contains[<c.args.get[2]>].not> && <player.in_group[Admin].not> {
- narrate "<red>Please use a valid mob!"
- queue clear
}
- adjust <player.flag[Mount]> set_entity_type:<c.args.get[2]>
- narrate "<Gold>Set your mount's type to <red><c.args.get[2]><gold>!"
- case list:
- narrate "<Gold>Allowed entity types:<white> <def[Allowed].comma_separated>"
- default:
- if <player.has_flag[MountSpawned]> {
- despawn <player.flag[Mount]>
- narrate "<Gold>Despawned your mount!"
- flag player MountSpawned:!
- queue clear
}
- spawn <player.flag[Mount]> <player.location>
- flag player MountSpawned:true
- narrate "<Gold>Spawned your mount!"
Mount_World:
debug: true
type: world
events:
on player quits:
- if <player.has_flag[MountSpawned]> {
- despawn <player.flag[Mount]>
- flag player MountSpawned:!
- queue clear
}