Date: 2019/12/02 15:18:56 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
mSurvivalShopCommand:
type: command
name: shop
usage: /shop
description: opens a shop gui
script:
- inventory open d:mSurvivalShop
mSurvivalShop:
type: inventory
debug: false
title: Shop
size: 54
procedural items:
- determine <s@mSurvivalShopList.yaml_key[items]>
definitions:
filler: gray_stained_glass_pane
slots:
- "[filler] [filler] [filler] [filler] [questionmark] [filler] [filler] [filler] [filler]"
- "[filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler]"
- "[filler] [] [] [] [] [] [] [] [filler]"
- "[filler] [] [] [] [] [] [] [] [filler]"
- "[filler] [filler] [filler] [] [] [] [filler] [filler] [filler]"
- "[filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler]"
questionmark:
type: item
debug: false
material: "i@player_head[display_name=<&f><&l>How to use;skull_skin=Jep|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmFkYzA0OGE3Y2U3OGY3ZGFkNzJhMDdkYTI3ZDg1YzA5MTY4ODFlNTUyMmVlZWQxZTNkYWYyMTdhMzhjMWEifX19|wot]"
lore:
- "<&e>Left-click <&f>to buy"
- "<&e>Shift Left-click <&f>to buy 32x"
- ""
- "<&e>Right-click <&f>to sell"
- "<&e>Shift Right-click <&f>to sell 32x"
price: 1000
mSurvivalShopEvent:
type: world
debug: false
events:
on player opens mSurvivalShop:
- playsound <player> sound:BLOCK_CHEST_OPEN volume:0.5
on player closes mSurvivalShop:
- playsound <player> sound:BLOCK_CHEST_OPEN volume:0.5 pitch:0.8
on player drags in mSurvivalShop:
- determine cancelled
on player clicks in mSurvivalShop:
- if <context.clicked_inventory> != in@mSurvivalShop:
- determine cancelled
- if <context.item> == i@gray_stained_glass_pane:
- determine cancelled
- determine cancelled passively
- choose <context.click>:
- case "LEFT":
- playsound <player> sound:BLOCK_STONE_BUTTON_CLICK_ON volume:0.5
- if <player.money> >= <context.item.script.yaml_key[price]>:
- narrate "You bought <&9><context.item.formatted> <&f>for <&9>$<context.item.script.yaml_key[price]>"
- take money quantity:<context.item.script.yaml_key[price]>
- give <context.item.script.yaml_key[material]>
- else:
- narrate "<&c>You don't have enough money to buy <context.item.formatted>"
- case "RIGHT":
- playsound <player> sound:BLOCK_STONE_BUTTON_CLICK_ON volume:0.5 pitch:0.8
- if <player.inventory.contains[<context.item.script.yaml_key[material]>]>:
- take <context.item.script.yaml_key[material]>
- narrate "You sold <&9><context.item.formatted> <&f>for <&9>$<context.item.script.yaml_key[price].mul[0.85]>"
- give money quantity:<context.item.script.yaml_key[price].mul[0.85]>
- else:
- narrate "<&c>You don't have <context.item.formatted> in your inventory"
- case "SHIFT_LEFT":
- playsound <player> sound:BLOCK_STONE_BUTTON_CLICK_ON volume:0.5
- if <player.money> >= <context.item.script.yaml_key[price].mul[32]>:
- narrate "You bought <&9>32x <&f>of <&9><context.item.formatted> <&f>for <&9>$<context.item.script.yaml_key[price].mul[32]>"
- take money quantity:<context.item.script.yaml_key[price].mul[32]>
- give <context.item.script.yaml_key[material]> quantity:32
- else:
- narrate "<&c>You don't have enough money to buy 32x of <context.item.formatted>"
- case "SHIFT_RIGHT":
- playsound <player> sound:BLOCK_STONE_BUTTON_CLICK_ON volume:0.5 pitch:0.8
- if <player.inventory.contains[<context.item.script.yaml_key[material]>].quantity[32]>:
- take <context.item.script.yaml_key[material]> quantity:32
- narrate "You sold 32 of <&9><context.item.formatted> <&f>for <&9>$<context.item.script.yaml_key[price].mul[32].mul[0.85]>"
- give money quantity:<context.item.script.yaml_key[price].mul[32].mul[0.85]>
- else:
- narrate "<&c>You don't have <context.item.formatted> in your inventory"
- default:
- narrate "<&c>Please follow the instructions"
mSurvivalShopList:
type: yaml data
items:
- mBread
- mApple
- mStone
#- mDirt
- mSand
- mGravel
- mGrassBlock
- mOakLog
- mCoal
- mRedstone
- mIronIngot
- mGoldIngot
- mLapisLazuli
- mBow
- mIronSword
- mIronAxe
- mIronPickAxe
#########################
#
# item:
# type: item
# debug: false
# material: i@stone
# lore:
# - <&7>Price: <&e>$<script.yaml_key[price]>
# - <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
# price:
#
#########################
mBread:
type: item
debug: false
material: bread
lore:
- test <yaml[mBread]>
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 15
mApple:
type: item
debug: false
material: apple
lore:
- <&7>Price: <&e>$<ScriptTag.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 20
mStone:
type: item
debug: false
material: stone
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 30
mSand:
type: item
debug: false
material: sand
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 35
mGravel:
type: item
debug: false
material: gravel
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 35
mDirt:
type: item
debug: false
material: dirt
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 25
mGrassBlock:
type: item
debug: false
material: grass_block
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 40
mOakLog:
type: item
debug: false
material: oak_log
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 30
mCoal:
type: item
debug: false
material: coal
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 25
mRedstone:
type: item
debug: false
material: redstone
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 50
mIronIngot:
type: item
debug: false
material: iron_ingot
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 120
mGoldIngot:
type: item
debug: false
material: gold_ingot
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 100
mLapisLazuli:
type: item
debug: false
material: lapis_lazuli
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 200
mBow:
type: item
debug: false
material: bow
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 60
mIronSword:
type: item
debug: false
material: iron_sword
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 40
mIronAxe:
type: item
debug: false
material: iron_axe
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 50
mIronPickAxe:
type: item
debug: false
material: iron_pickaxe
lore:
- <&7>Price: <&e>$<script.yaml_key[price]>
- <&7>Sell price: <&e>$<script.yaml_key[price].mul[0.85]>
price: 70