- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleBackpacks!
TypeDenizen Script
Date2019/11/26 11:39:07 UTC-08:00
ByGuest
Other
Paste
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
12000
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

medium_backpack:
  type: item
  debug: false
  material: chest
  display name<&a>Medium Backpack
  lore:
  - "<&a>18 Slot Backpack"
  - "<&e>A medium backpack for extra storage"
  - "<&e>Right click while holding to open it."
  backpack_size: 18

large_backpack:
  type: item
  debug: false
  material: chest
  display name<&a>Large Backpack
  lore:
  - "<&a>27 Slot Backpack"
  - "<&e>A large backpack for extra storage"
  - "<&e>Right click while holding to open it."
  backpack_size: 27

giant_backpack:
  type: item
  debug: false
  material: chest
  display name<&a>Giant Backpack
  lore:
  - "<&a>36 Slot Backpack"
  - "<&e>A giant backpack for extra storage"
  - "<&e>Right click while holding to open it."
  backpack_size: 36

enourmous_backpack:
  type: item
  debug: false
  material: chest
  display name<&a>Enourmous Backpack
  lore:
  - "<&a>45 Slot Backpack"
  - "<&e>A enourmous backpack for extra storage"
  - "<&e>Right click while holding to open it."
  backpack_size: 45

blackhole_backpack:
  type: item
  debug: false
  material: black_concrete
  display name<&6>Portable Black Hole
  lore:
  - "<&a>54 Slot Backpack"
  - "<&e>A portal black hole for extra storage"
  - "<&e>Because why not?"
  - "<&e>Right click while holding to open it."
  backpack_size: 54

backpack_inventory:
  type: inventory
  debug: false
  title<&7>Bork
  size: 9

backpack_task_open:
  type: task
  debug: false
  script:
    - note <inventory[backpack_inventory]> as:<player.uuid>.opened_backpack
    - adjust <inventory[<player.uuid>.opened_backpack]> size:<context.item.script.yaml_key[backpack_size]>
    - adjust <inventory[<player.uuid>.opened_backpack]> title:<context.item.display||<context.material>>
    - inventory add d:<inventory[<player.uuid>.opened_backpack]> o:<context.item.nbt[backpack.contents].unescaped||<list[]>>
    - inventory open d:<inventory[<player.uuid>.opened_backpack]>

backpack_events:
  type: world
  debug: false
  events:
    on player right clicks with simple_backpack:
      - determine passively cancelled
      - inject backpack_task_open

    on player right clicks with medium_backpack:
      - determine passively cancelled
      - inject backpack_task_open

    on player right clicks with large_backpack:
      - determine passively cancelled
      - inject backpack_task_open

    on player right clicks with giant_backpack:
      - determine passively cancelled
      - inject backpack_task_open

    on player right clicks with enourmous_backpack:
      - determine passively cancelled
      - inject backpack_task_open

    on player right clicks with blackhole_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>
      - note remove as:<context.inventory.notable_name>



RawRaw



Pastes made: 66664