Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. command /stockchests2:
  2. permission: fuiwfuwoefaw
  3. trigger:
  4. loop all blocks in radius 100 of {map}:
  5. if loop-block is a chest:
  6. set {_chance} to a random integer between 1 and 5
  7. if {_chance} is 1:
  8. spawnJunk(loop-block)
  9. if {_chance} is 2:
  10. clear inventory of loop-block
  11. set {_item} to gold ingot
  12. loop 10 times:
  13. add {_item} to inventory of loop-block
  14. if {_chance} is 3:
  15. spawnJunk(loop-block)
  16. if {_chance} is 4:
  17. spawnJunk(loop-block)
  18. if {_chance} is 5:
  19. spawnJunk(loop-block)
  20.  
  21. every 5 minutes:
  22. make console execute command "/stockchests2"
  23.  
  24. function spawnJunk(b: block):
  25. clear inventory of {_b}
  26. set {_countchance} to a random integer between 1 and 5
  27. if {_countchance} is 1:
  28. loop 10 times:
  29. set {_item} to a random element of {junk::*}
  30. add {_item} to inventory of {_b}
  31. if {_countchance} is 2:
  32. loop 6 times:
  33. set {_item} to a random element of {junk::*}
  34. add {_item} to inventory of {_b}
  35. if {_countchance} is 3:
  36. loop 3 times:
  37. set {_item} to a random element of {junk::*}
  38. add {_item} to inventory of {_b}
  39. if {_countchance} is 4:
  40. loop 2 times:
  41. set {_item} to a random element of {junk::*}
  42. add {_item} to inventory of {_b}
  43. if {_countchance} is 5:
  44. loop 8 times:
  45. set {_item} to a random element of {junk::*}
  46. add {_item} to inventory of {_b}
  47.  
  48. on craft of golden block:
  49. cancel event
  50.  
  51.  
  52. on load:
  53. set {junk::*} to ""
  54. wait 1 tick
  55. add 1 mycelium with name "Trash" to {junk::*}
  56. add 1 glass pane with name "Shard" to {junk::*}
  57. add 1 dried kelp to {commonchestitems::*}
  58.  
  59. command /mapset:
  60. permission: never
  61. trigger:
  62. set {map} to player's location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement