Paste #53172: qwe2

Date: 2019/03/09 19:03:53 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


PlayerBank_Command:
  type: command
  debug: true
  name: PlayerBank
  definitions: BankID
  script:
  - define BankID <def[BankID]||1>
  - define pBank <player.uuid>pBank_<def[BankID]>
  - define title "Bank <&pipe> Page<&co><def[BankID]>"
  - note "in@generic[title=<def[title]>;size=54]" as:<def[pBank]>
  - define items <yaml[pBankKey].read[<player.uuid>.<def[BankID]>]||null>
  - if <def[BankID]> > 1:
    - define LeftArrow i@BankLeftArrow[nbt=BankID/<def[BankID].add[1]>]
  - else:
    - define LeftArrow i@blank
  # - define LeftArrow i@BankLeftArrow[nbt=BankID/<def[BankID].sub[1]>]
  - define RightArrow i@BankRightArrow[nbt=BankID/<def[BankID].add[1]>]
  - define SoftMenu "<def[LeftArrow]>|i@Blank|i@Blank|i@Blank|i@Blank|i@Blank|i@Blank|i@Blank|<def[RightArrow]>"
  - foreach <def[SoftMenu]>:
    - inventory add slot:<def[loop_index].add[45]> d:in@<def[pBank]> origin:<def[value]>
  - if <def[items]> != null:
    - inventory set d:in@<def[pBank]> o:<def[items]>
  - inventory open d:in@<def[pBank]>