Date: 2015/12/03 19:41:55 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#-------------------------#
#--GadgetTool--v0.1-----#
#--------------------#
#----------------#
############
###CONFIG###
############
gadget_config:
type: yaml data
GadgetTool:
#---------------------#
#MODES#
#---------------------#
Modes:
default:
item: compass
arrows:
item: nether_fence
#---------------------#
##########
###ITEM###
##########
gadget_item:
type: item
material: <s@gadget_config.yaml_key[GadgetTool.Modes.<player.flag[GadgetTool.Mode]>.item].as_item||<s@gadget_config.yaml_key[GadgetTool.Modes.default.item]>>
display name: GadgetTool
lore:
- Mode<&co> <player.flag[GadgetTool.Mode]||default>
- Versitile shapeshifting tool.
- Use carefully and wisely.
#############
###COMMAND###
#############
gadget_command:
type: command
debug: true
name: gadget
description: GadgetTool command.
usage: /gadget
aliases:
- gg
permission: gadget.command
allowed help:
- determine <player.is_op||<player.has_permission[gadget.command]>>
script:
- if <context.server||true> {
- announce to_console "<&c>This command is for players only!"
- queue clear
}
- if <player.has_permission[gadget.command].not||true> {
- narrate "<&c>Sorry, you don't have permission to perform this command!"
- queue clear
}
- define Args <context.args>
- if <def[Args].size||0> == 0 {
- flag player GadgetTool.Mode:default
- if <player.inventory.contains.display[strict:GadgetTool]||false> {
- take bydisplay:GadgetTool
- inject s@gadget_update
- queue clear
}
- inject s@gadget_update
- queue clear
}
- if <s@gadget_config.list_keys[GadgetTool.Modes].contains[<def[Args].get[1]>].not||true> {
- narrate "<&c>Sorry <&f><def[Args].get[1]> <&c>is not a valid mode!"
- queue clear
}
- flag player GadgetTool.Mode:<def[Args].get[1]>
- if <player.inventory.contains.display[strict:GadgetTool]||false> {
- take bydisplay:GadgetTool
- inject s@gadget_update
- queue clear
}
- inject s@gadget_update
####################
###EVENT##HANDLERS##
####################
gadget_handler:
type: world
debug: true
events:
on player left clicks with i@gadget_item:
- determine passively cancelled
- inject s@<player.flag[GadgetTool.Mode]||default>_left
on player right clicks with i@gadget_item:
- determine passively cancelled
- inject s@<player.flag[GadgetTool.Mode]||default>_right
###########
###TASKS###
###########
gadget_update:
type: task
debug: true
script:
- give i@gadget_item
default_left:
type: task
debug: true
script:
- playeffect <player.location> effect:HUGE_EXPLOSION quantity:1
default_right:
type: task
debug: true
script:
- playeffect <player.location> effect:LARGE_SMOKE quantity:1
arrows_left:
type: task
debug: true
script:
- playsound ZOMBIE_WOODBREAK <player.location> pitch:6 volume:1
- shoot e@arrow speed:5 shooter:<player>
arrows_right:
type: task
debug: true
script:
- playsound ZOMBIE_WOODBREAK <player.location> pitch:6 volume:10
- shoot small_fireball speed:5 shooter:<player>