Date: 2019/11/26 07:52:57 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
simple_backpack:
type: item
debug: false
material: chest
display name: <&7>Simple Backpack
lore:
- "<&a>9 Slot Backpack"
- "<&e>A simple backpack for extra storage"
- "<&e>Right click while holding to open it."
backpack_size: 9
backpack_inventory:
type: inventory
debug: false
size: <player.flag[backpacks.backpack.size]||9>
title: <player.flag[backpacks.backpack.title]||<&c>BROKEN<&sp>INVENTORY>
procedural items:
- determine <player.flag[backpacks.backpack.contents].unescaped||<list[]>>
backpack_task_open:
type: task
script:
- flag player backpacks.backpack.size:<context.item.script.yaml_key[backpack_size]||9> duration:2t
- flag player backpacks.backpack.title:<context.item.display||<context.material>> duration:2t
- flag player backpacks.backpack.contents:<context.item.nbt[backpack.contents]||<list[]>> duration:2t
- inventory open d:backpack_inventory
backpack_events:
type: world
debug: false
events:
on player right clicks with simple_backpack:
- determine passively cancelled
- inject backpack_task_open
on player clicks item in backpack_inventory:
- if <context.item.script.yaml_key[backpack_size]||null> != null:
- determine cancelled
on player closes backpack_inventory:
- adjust <player.item_in_hand> nbt:backpack.contents/<context.inventory.list_contents.escaped> save:new_bp
- inventory set slot:<player.held_item_slot> o:<entry[new_bp].result>