Date: 2019/08/16 09:32:44 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
my_inventory_menu:
type: inventory
title: Currency Changer
size: 27
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [i@my_inventory_menu_slot12] [] [i@my_inventory_menu_slot14] [] [] []"
- "[] [] [] [] [] [] [] [] []"
my_inventory_menu_slot12:
type: item
material: diamond
display name: Diamonds --> Money
my_inventory_menu_slot14:
type: item
material: diamond
display name: Money --> Diamonds
my_inventory_menu_handler:
type: world
events:
on player clicks in my_inventory_menu:
- determine cancelled
on player drags in my_inventory_menu:
- determine cancelled
on player clicks my_inventory_menu_slot12 in my_inventory_menu:
- if <player.inventory.contains.material[diamond]>:
- take diamond
- give money quantity:100
- playsound <player> sound:ENTITY_EXPERIENCE_ORB_PICKUP
- else:
- inventory set destination:<context.inventory> origin:i@glass slot:12
on player clicks my_inventory_menu_slot14 in my_inventory_menu:
- if <player.money> >= 100:
- give diamond
- take money quantity:100
- playsound <player> sound:ENTITY_EXPERIENCE_ORB_PICKUP
- else:
- inventory set destination:<context.inventory> origin:i@glass slot:14
inventorychange_command:
type: command
debug: false
name: inventorychange
usage: /inventorychange
description: Open's Currency Trader.
script:
- inventory open d:in@my_inventory_menu