UDON_JP

Untitled

Apr 11th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. command /chestrandom:
  2. permission: system.random
  3. trigger:
  4. loop {chests::*}:
  5. set {_items} to random integer between 1 to 10
  6. set {_mode} to random integer between 1 to 5
  7. set {_chest} to loop-value
  8. send "&eLocation:&b %location of loop-value%"
  9. send "&eItems:&b %{_items}%"
  10. send "&eMode:&b %{_mode}%"
  11. remove all items from loop-value's inventory
  12. loop {_items} times:
  13. set {_slot} to random integer between 0 to 26
  14. if {_mode} is 1:
  15. set slot {_slot} of {_chest} to diamond
  16. send "&eSlot &b%{_slot}%&e to &aDiamond"
  17. if {_mode} is 2:
  18. set slot {_slot} of {_chest} to emerald
  19. send "&eSlot &b%{_slot}%&e to &aEmerald"
  20. if {_mode} is 3:
  21. set slot {_slot} of {_chest} to iron ingot
  22. send "&eSlot &b%{_slot}%&e to &aIron ingot"
  23. if {_mode} is 4:
  24. set slot {_slot} of {_chest} to gold ingot
  25. send "&eSlot &b%{_slot}%&e to &aGold ingot"
  26. if {_mode} is 5:
  27. set {_ingot} to random integer between 1 to 2
  28. if {_ingot} is 1:
  29. set slot {_slot} of {_chest} to gold ingot
  30. send "&eSlot &b%{_slot}%&e to &aGold ingot&7(Mode 5)"
  31. if {_ingot} is 2:
  32. set slot {_slot} of {_chest} to iron ingot
  33. send "&eSlot &b%{_slot}%&e to &aIron ingot&7(Mode 5)"
  34. command /chests [<text>]:
  35. permission: system.chestrandom
  36. trigger:
  37. if arg 1 is "add":
  38. send "&b選択するチェストを破壊してください。"
  39. set {%player%.breakchest} to "addmode"
  40. if arg 1 is "remove":
  41. send "&b選択するチェストを破壊してください。"
  42. set {%player%.breakchest} to "removemode"
  43. if arg 1 is "adds":
  44. send "&b選択するチェストを破壊してください。"
  45. send "&b/chests stopで終了できます。"
  46. set {%player%.breakchest} to "addsmode"
  47. if arg 1 is "removes":
  48. send "&b選択するチェストを破壊してください。"
  49. send "&b/chests stopで終了できます。"
  50. set {%player%.breakchest} to "removesmode"
  51. if arg 1 is "stop":
  52. send "&b選択を終了しました。"
  53. set {%player%.breakchest} to ""
  54. if arg 1 is "reset":
  55. loop {chests::*}:
  56. remove loop-value from {chests::*}
  57. send "&b%location of loop-value%&e のチェストを消去しました。"
  58.  
  59. on break:
  60. if {%player%.breakchest} is "addmode":
  61. cancel event
  62. if event-block is not chest:
  63. send "&c対象のブロックはチェストではありません。"
  64. set {%player%.breakchest} to ""
  65. stop
  66. if event-block contains {chests::*}:
  67. send "&c既に追加されています。"
  68. set {%player%.breakchest} to ""
  69. stop
  70. add event-block to {chests::*}
  71. send "&b%location of event-block%&e を追加しました。"
  72. set {%player%.breakchest} to ""
  73. stop
  74. if {%player%.breakchest} is "removemode":
  75. cancel event
  76. if event-block is not chest:
  77. send "&c対象のブロックはチェストではありません。"
  78. set {%player%.breakchest} to ""
  79. stop
  80. if event-block does not contain {chests::*}:
  81. send "&c追加されていません。"
  82. set {%player%.breakchest} to ""
  83. stop
  84. remove event-block from {chests::*}
  85. send "&b%location of event-block%&e を削除しました。"
  86. set {%player%.breakchest} to ""
  87. stop
  88. if {%player%.breakchest} is "addsmode":
  89. cancel event
  90. if event-block is not chest:
  91. send "&c対象のブロックはチェストではありません。"
  92. stop
  93. if event-block contains {chests::*}:
  94. send "&c既に追加されています。"
  95. stop
  96. add event-block to {chests::*}
  97. send "&b%location of event-block%&e を追加しました。"
  98. stop
  99. if {%player%.breakchest} is "removesmode":
  100. cancel event
  101. if event-block is not chest:
  102. send "&c対象のブロックはチェストではありません。"
  103. stop
  104. if event-block does not contain {chests::*}:
  105. send "&c追加されていません。"
  106. stop
  107. remove event-block from {chests::*}
  108. send "&b%location of event-block%&e を削除しました。"
  109. stop
Add Comment
Please, Sign In to add comment