chest randomizer

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

boos_tv

Member
Jul 1, 2020
2
0
1
20
Hello i am try to fill single chests whith random items but it isnt working on them it just works on doble chests. Can some one help? (sory for my english) the script is down below.... (i now that there is some items that aren't in game (dont mind them) i just need that it works on single chests)
  1. on load:
  2. clear {chestitems::*}
  3. add 5 wood to {chestitems::*}
  4. add 1 diamond pickaxe to {chestitems::*}
  5. add wooden sword of sharpness 2 to {chestitems::*}
  6. add 1 diamond sword to {chestitems::*}
  7. add 1 diamond helmet of fire protection 1 to {chestitems::*}
  8. add 10 arrow to {chestitems::*}
  9. add 1 ender pearl to {chestitems::*}
  10. add 23 xp bottle to {chestitems::*}
  11. add 5 golden apple to {chestitems::*}
  12. add 1 iron sword to {chestitems::*}
  13. add 1 ender pearl to {chestitems::*}
  14. add 23 xp bottle to {chestitems::*}
  15. add 1 golden apple to {chestitems::*}
  16. add 1 diamond pickaxe to {chestitems::*}
  17. add 1 iron axe to {chestitems::*}
  18. add 1 ender pearl to {chestitems::*}
  19. add 23 xp bottle to {chestitems::*}
  20. add 5 golden apple to {chestitems::*}
  21. add 1 wooden sword of sharpness 2 to {chestitems::*}
  22. add 1 diamond chestplate of fire protection 1 to {chestitems::*}
  23. add 12 arrow to {chestitems::*}
  24. add 1 slimeball of knockback 5 to {chestitems::*}
  25. add 1 ender pearl to {chestitems::*}
  26. add 23 xp bottle to {chestitems::*}
  27. add 5 golden apple to {chestitems::*}
  28. add 12 stained hardened clay to {chestitems::*}
  29. add 1 diamond sword to {chestitems::*}
  30. add diamond chestplate of fire protection 4 to {chestitems::*}
  31. add 1 bow of flame 1 to {chestitems::*}
  32. add 1 diamond sword to {chestitems::*}
  33. add 1 golden boots of fire protection 4 to {chestitems::*}
  34. add 5 golden apple to {chestitems::*}
  35. add 12 stained hardened clay to {chestitems::*}
  36. add 1 golden helmet of fire protection 4 to {chestitems::*}
  37. add 1 lava bucket to {chestitems::*}
  38. add 8 cooked beef to {chestitems::*}
  39. add 23 xp bottle to {chestitems::*}
  40. add 12 stained hardened clay to {chestitems::*}
  41. add 1 diamond helmet of fire protection to {chestitems::*}
  42. add 1 golden sword of fire aspect 1 to {chestitems::*}
  43. add 1 diamond leggings of fire protection 4 to {chestitems::*}
  44. add 5 golden apple to {chestitems::*}
  45. add 12 stained hardened clay to {chestitems::*}
  46. add 1 wooden sword of sharpness 2 to {chestitems::*}
  47. add 12 wood to {chestitems::*}
  48. add 10 arrow to {chestitems::*}
  49. add 1 ender pearl to {chestitems::*}
  50. add 23 xp bottle to {chestitems::*}
  51. add 5 golden apple to {chestitems::*}
  52. add 12 stained hardened clay to {chestitems::*}
  53. add 1 diamond helmet of fire protection 1 to {chestitems::*}
  54. add 1 diamond pickaxe to {chestitems::*}
  55. add 1 iron axe to {chestitems::*}
  56. add 8 stone:1 to {chestitems::*}
  57. add 1 iron axe to {chestitems::*}
  58. add 1 ender pearl to {chestitems::*}
  59. add 23 xp bottle to {chestitems::*}
  60. add 5 golden apple to {chestitems::*}
  61. add 1 wooden sword of sharpness 2 to {chestitems::*}
  62. add 1 diamond sword to {chestitems::*}
  63. add 12 arrow to {chestitems::*}
  64. add 1 bow to {chestitems::*}
  65. add 1 wooden sword of sharpness 2 to {chestitems::*}
  66. add 1 diamond sword of fire aspect 1 to {chestitems::*}
  67. add 12 arrow to {chestitems::*}
  68. add 10 arrow to {chestitems::*}
  69. add 1 diamond boots of fire protection 4 to {chestitems::*}
  70. add 1 diamond helmet of fire protection 4 to {chestitems::*}
  71. add 1 stone sword of fire aspect 1 to {chestitems::*}
  72. add 1 bow of infinity to {chestitems::*}
  73. add 1 golden boots of fire protection 4 to {chestitems::*}
  74. add 1 iron block to {chestitems::*}
  75. add 1 stick to {chestitems::*}
  76. add 1 bow of flame 1 to {chestitems::*}
  77. add 1 arrow to {chestitems::*}
  78. add 12 arrow to {chestitems::*}
  79. add 1 diamond sword to {chestitems::*}
  80. add 1 diamond sword of sharpness 1 to {chestitems::*}
  81. add 1 leather chestplate of fire protection 4 to {chestitems::*}
  82. add 8 stone:1 to {chestitems::*}
  83. command /items:
  84. trigger:
  85. loop all blocks in radius 200 of player:
  86. if loop-block is a chest:
  87. loop (random integer between 1 and 30) times:
  88. set {_item} to a random element of {chestitems::*}
  89. add {_item} to block at loop-value
 
Now, im not 100% sure how to do this, however, a way that would make this script smaller, is putting all of those in a options section like so:
Code:
options:
    chestItems: item1, example2, item3
...chance of num%:
    set {_i} to random item out of {@chestItems}
    add {_i} to (variable for the chest.)

do note, im not sure if the way of putting items in a chest even works, so.
tnx for the answer but found that i can just modify some skywars plugin. it's perfect for my needs (there is just one problem)
 
Status
Not open for further replies.