Paste #16876: Untitled Paste

Date: 2015/06/24 03:36:11 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14


TreasureTask:
  type: task
  script:
  - define chestLocation l@<util.random.int[-15000].to[15000]>,<util.random.int[6].to[28]>,<util.random.int[-15000].to[15000]>
  - define chestContents li@i@diamond[quantity=<util.random.int[1].to[32]>]|i@dirt[quantity=<util.random.int[1].to[64]>]
  - define chestContents %chestContents%|li@i@gold_ingot[quantity=<util.random.int[1].to[56]>]|i@diamond_sword[enchantments=DAMAGE_ALL,2|DURABILITY,2;display_name=Sharp_Sword]
  - define chestContents %chestContents%|li@i@diamond_chestplate|i@diamond_leggings|i@diamond_boots|i@dirt|i@stone|i@stone|i@stone|i@diamondsword
  - modifyblock <def[chestLocation]> chest
  - announce "Treasure chest has been found at <def[chestLocation]>."
  - foreach <def[chestContents]> {
    - if <util.random.int[1].to[10]> > 5 {
      - give <def[value]> to:in@location[holder=<def[chestlocation]>]
    }  
  }