Date: 2016/12/14 10:24:03 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
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
######################################################################
#Random Chest Instructions: Simply insert this script into your #
#scripts folder. Once inserted, you can easily copy and paste, then #
#edit the appropriate sections. #
#The areas you need to edit are noted below. #
#To Make a new chest: Copy everything below "on player right clicks #
#chest:" and paste it before the last "- queue clear". #
#To add items, simply add extra "- inventory add" commands or you can#
#also add cash using the "money" command. You can add as many to #
#each #
#If statement as you'd like. #
#To change the chance of each item just change the number ranges to #
#reflect your percentages. #
#Be sure to give your new chests unique flags!!! #
######################################################################
randomchest:
type: world
events:
on player right clicks chest:
- if <context.location.simple> == -2560,61,-2932,world && <player.has_flag[testchest].not> {
- define contents <util.random.int[1].to[100]>
- wait .1s
}
- if <def[contents]> < 10 {
- inventory add d:<player.open_inventory> && <player.has_flag[testchest].not> o:i@386
- flag player testchest
- queue clear
}
- if <def[contents]> >= 10 && <def[contents]> && <player.has_flag[testchest].not> < 20 {
- inventory add d:<player.open_inventory> o:i@sand[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 20 && <def[contents]> && <player.has_flag[testchest].not> < 30 {
- inventory add d:<player.open_inventory> o:i@gold_ingot[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 30 && <def[contents]> && <player.has_flag[testchest].not> < 40 {
- inventory add d:<player.open_inventory> o:i@iron_ingot[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 40 && <def[contents]> && <player.has_flag[testchest].not> < 50 {
- inventory add d:<player.open_inventory> o:i@stick[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 50 && <def[contents]> < 60 && <player.has_flag[testchest].not> {
- inventory add d:<player.open_inventory> o:i@redstone[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 60 && <def[contents]> < 70 && <player.has_flag[testchest].not> {
- inventory add d:<player.open_inventory> o:i@stone[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 70 && <def[contents]> < 80 && <player.has_flag[testchest].not> {
- inventory add d:<player.open_inventory> o:i@diamond[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 80 && <def[contents]> < 90 && <player.has_flag[testchest].not> {
- inventory add d:<player.open_inventory> o:i@dirt[quantity=32]
- flag player testchest
- queue clear
}
- if <def[contents]> >= 90 && <def[contents]> < 101 && <player.has_flag[testchest].not> {
- inventory add d:<player.open_inventory> o:i@planks[quantity=32]
- flag player testchest
- queue clear
}
- queue clear