henry900326

Untitled

Jan 28th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.46 KB | None | 0 0
  1. command /equip [<text>]:
  2. trigger:
  3. open chest with 6 rows named "&e&l 裝備介面" to player
  4. wait 1 ticks
  5. if inventory name of player's current inventory contains "裝備介面":
  6. loop 54 times:
  7. set slot (loop-number - 1) of player's current inventory to 1 of snow layer named "&f空白欄"
  8. loop 9 times:
  9. set slot (loop-number - 1) of player's current inventory to 1 of gray stained glass pane named "&7"
  10. set slot (loop-number + 45) of player's current inventory to 1 of gray stained glass pane named "&7"
  11. loop 5 times:
  12. set slot ((loop-number - 1) * 9) of player's current inventory to 1 of gray stained glass pane named "&7"
  13. set slot ((loop-number - 1) * 9 + 8) of player's current inventory to 1 of gray stained glass pane named "&7"
  14. set slot 0 of player's current inventory to 1 of red stained glass pane named "&7"
  15. set slot 45 of player's current inventory to 1 of red stained glass pane named "&7"
  16. set slot 8 of player's current inventory to 1 of red stained glass pane named "&7"
  17. set slot 53 of player's current inventory to 1 of red stained glass pane named "&7"
  18. loop 4 times:
  19. set slot (9 * loop-number) of player's current inventory to 1 of black stained glass pane named "&7"
  20. set slot (9 * loop-number + 8) of player's current inventory to 1 of black stained glass pane named "&7"
  21. set slot (loop-number * 9 + 3) of player's current inventory to 1 of black stained glass pane named "&7"
  22. set slot 10 of player's current inventory to leather helmet named "&e帽子" with lore "&9請放在旁邊的格子裏"
  23. set slot 19 of player's current inventory to leather chestplate named "&e衣服" with lore "&9請放在旁邊的格子裏"
  24. set slot 28 of player's current inventory to leather leggings named "&e褲子" with lore "&9請放在旁邊的格子裏"
  25. set slot 37 of player's current inventory to leather boots named "&e鞋子" with lore "&9請放在旁邊的格子裏"
  26. set slot 13 of player's current inventory to spawn egg named "&e寵物" with lore "&9請放在旁邊的格子裏"
  27. set slot 15 of player's current inventory to string named "&e墜飾" with lore "&9請放在旁邊的格子裏"
  28. set slot 22 of player's current inventory to wooden sword named "&e副手武器" with lore "&9請放在旁邊的格子裏"
  29. set slot 24 of player's current inventory to nether star named "&e勳章" with lore "&9請放在旁邊的格子裏"
  30. set slot 31 of player's current inventory to lead named "&e腰帶" with lore "&9請放在旁邊的格子裏"
  31. set slot 33 of player's current inventory to leather named "&e肩飾" with lore "&9請放在旁邊的格子裏"
  32. set slot 40 of player's current inventory to paper named "&e披風" with lore "&9請放在旁邊的格子裏"
  33. set slot 42 of player's current inventory to diamond named "&e戒指" with lore "&9請放在旁邊的格子裏"
  34. if file existance of "plugins/equip/%player%/1.yml" is true:
  35. set {_slot} to 11
  36. set {_裝備id.1} to single value "id" get of "plugins/equip/%player%/1.yml"
  37. set {_裝備id.1} to {_裝備id.1} parsed as item
  38. set {_nbt.1} to yaml value "nbt" from file "plugins/equip/%player%/1.yml"
  39. set slot {_slot} of player's current inventory to 1 of {_裝備id.1} with nbt "%{_nbt.1}%"
  40. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  41. if file existance of "plugins/equip/%player%/2.yml" is true:
  42. set {_slot} to 20
  43. set {_裝備id.2} to single value "id" get of "plugins/equip/%player%/2.yml"
  44. set {_裝備id.2} to {_裝備id.2} parsed as item
  45. set {_nbt.2} to yaml value "nbt" from file "plugins/equip/%player%/2.yml"
  46. set slot {_slot} of player's current inventory to 1 of {_裝備id.2} with nbt "%{_nbt.2}%"
  47. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  48. if file existance of "plugins/equip/%player%/3.yml" is true:
  49. set {_slot} to 29
  50. set {_裝備id.3} to single value "id" get of "plugins/equip/%player%/3.yml"
  51. set {_裝備id.3} to {_裝備id.3} parsed as item
  52. set {_nbt.3} to yaml value "nbt" from file "plugins/equip/%player%/3.yml"
  53. set slot {_slot} of player's current inventory to 1 of {_裝備id.3} with nbt "%{_nbt.3}%"
  54. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  55. if file existance of "plugins/equip/%player%/4.yml" is true:
  56. set {_slot} to 38
  57. set {_裝備id.4} to single value "id" get of "plugins/equip/%player%/4.yml"
  58. set {_裝備id.4} to {_裝備id.4} parsed as item
  59. set {_nbt.4} to yaml value "nbt" from file "plugins/equip/%player%/4.yml"
  60. set slot {_slot} of player's current inventory to 1 of {_裝備id.4} with nbt "%{_nbt.4}%"
  61. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  62. if file existance of "plugins/equip/%player%/5.yml" is true:
  63. set {_slot} to 14
  64. set {_裝備id.5} to single value "id" get of "plugins/equip/%player%/5.yml"
  65. set {_裝備id.5} to {_裝備id.5} parsed as item
  66. set {_nbt.5} to yaml value "nbt" from file "plugins/equip/%player%/5.yml"
  67. set slot {_slot} of player's current inventory to 1 of {_裝備id.5} with nbt "%{_nbt.5}%"
  68. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  69. if file existance of "plugins/equip/%player%/6.yml" is true:
  70. set {_slot} to 16
  71. set {_裝備id.6} to single value "id" get of "plugins/equip/%player%/6.yml"
  72. set {_裝備id.6} to {_裝備id.6} parsed as item
  73. set {_nbt.6} to yaml value "nbt" from file "plugins/equip/%player%/6.yml"
  74. set slot {_slot} of player's current inventory to 1 of {_裝備id.6} with nbt "%{_nbt.6}%"
  75. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  76. if file existance of "plugins/equip/%player%/7.yml" is true:
  77. set {_slot} to 23
  78. set {_裝備id.7} to single value "id" get of "plugins/equip/%player%/7.yml"
  79. set {_裝備id.7} to {_裝備id.7} parsed as item
  80. set {_nbt.7} to yaml value "nbt" from file "plugins/equip/%player%/7.yml"
  81. set slot {_slot} of player's current inventory to 1 of {_裝備id.7} with nbt "%{_nbt.7}%"
  82. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  83. if file existance of "plugins/equip/%player%/8.yml" is true:
  84. set {_slot} to 25
  85. set {_裝備id.8} to single value "id" get of "plugins/equip/%player%/8.yml"
  86. set {_裝備id.8} to {_裝備id.8} parsed as item
  87. set {_nbt.8} to yaml value "nbt" from file "plugins/equip/%player%/8.yml"
  88. set slot {_slot} of player's current inventory to 1 of {_裝備id.8} with nbt "%{_nbt.8}%"
  89. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  90. if file existance of "plugins/equip/%player%/9.yml" is true:
  91. set {_slot} to 32
  92. set {_裝備id.9} to single value "id" get of "plugins/equip/%player%/9.yml"
  93. set {_裝備id.9} to {_裝備id.9} parsed as item
  94. set {_nbt.9} to yaml value "nbt" from file "plugins/equip/%player%/9.yml"
  95. set slot {_slot} of player's current inventory to 1 of {_裝備id.9} with nbt "%{_nbt.9}%"
  96. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  97. if file existance of "plugins/equip/%player%/10.yml" is true:
  98. set {_slot} to 34
  99. set {_裝備id.10} to single value "id" get of "plugins/equip/%player%/10.yml"
  100. set {_裝備id.10} to {_裝備id.10} parsed as item
  101. set {_nbt.10} to yaml value "nbt" from file "plugins/equip/%player%/10.yml"
  102. set slot {_slot} of player's current inventory to 1 of {_裝備id.10} with nbt "%{_nbt.10}%"
  103. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  104. if file existance of "plugins/equip/%player%/11.yml" is true:
  105. set {_slot} to 41
  106. set {_裝備id.11} to single value "id" get of "plugins/equip/%player%/11.yml"
  107. set {_裝備id.11} to {_裝備id.11} parsed as item
  108. set {_nbt.11} to yaml value "nbt" from file "plugins/equip/%player%/11.yml"
  109. set slot {_slot} of player's current inventory to 1 of {_裝備id.11} with nbt "%{_nbt.11}%"
  110. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  111. if file existance of "plugins/equip/%player%/12.yml" is true:
  112. set {_slot} to 43
  113. set {_裝備id.12} to single value "id" get of "plugins/equip/%player%/12.yml"
  114. set {_裝備id.12} to {_裝備id.12} parsed as item
  115. set {_nbt.12} to yaml value "nbt" from file "plugins/equip/%player%/12.yml"
  116. set slot {_slot} of player's current inventory to 1 of {_裝備id.12} with nbt "%{_nbt.12}%"
  117. set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
  118. on inventory click:
  119. if inventory name of player's current inventory contains "裝備介面":
  120. if name of clicked item is "&7":
  121. cancel event
  122. wait 1 ticks
  123. close player's inventory
  124. stop
  125. if line 1 of lore of clicked item is "&9請放在旁邊的格子裏":
  126. cancel event
  127. wait 1 ticks
  128. close player's inventory
  129. stop
  130. if clicked type is left mouse button or double click using mouse:
  131. if name of clicked item is "&f空白欄":
  132. set clicked item to air
  133. if line 1 of lore of slot (clicked raw slot - 1) of player's current inventory is "&9請放在旁邊的格子裏":
  134. if "%name of clicked item%" isn't "<none>" or "&f空白欄":
  135. set {_lore::*} to uncolored lore of clicked item split at "||"#設定lore為所有的注釋
  136. loop {_lore::*}:#循環讀取所有lore一次
  137. if {_lore::%loop-index%} contains "-":
  138. replace all "-" and " " with "" in {_lore::%loop-index%}
  139. set {_save} to "%{_lore::%loop-index%}%"
  140. set {_save2} to "%{_save}%"
  141. loop 10 times:
  142. replace all "%loop-number - 1%" with "" in {_save}
  143. replace all "%{_save}%" with "" in {_save2}
  144. set {_save2} to {_save2} parsed as integer
  145. set {玩家資料.%player%::%{_save}%} to {玩家資料.%player%::%{_save}%} - {_save2}
  146. if id of clicked cursor is 0:#如果按的物品是空氣
  147. stop
  148. else:
  149. set {_name} to clicked cursor
  150. if "%{_name}%" is "<none>":#如果按的物品沒有名稱
  151. cancel event
  152. stop
  153. set {_pass} to 0
  154. set {_lore::*} to uncolored lore of clicked cursor split at "||"#設定lore為所有的注釋
  155. loop {_lore::*}:#循環讀取所有lore一次
  156. set {_name} to slot (clicked raw slot - 1) of player's current inventory
  157. set {_name} to uncolored name of {_name}
  158. if {_lore::%loop-index%} contains "%{_name}%":
  159. set {_pass} to 1
  160. if {_pass} is 0:
  161. cancel event
  162. if {_pass} is 1:
  163. loop {_lore::*}:
  164. if {_lore::%loop-index%} contains "等級需求":
  165. replace all "等級需求" , ":" and " " with "" in {_lore::%loop-index%}
  166. set {_lore::%loop-index%} to {_lore::%loop-index%} parsed as integer
  167. if {玩家資料.%player%::玩家等級} is more than or equal to {_lore::%loop-index%}:
  168. set {_pass} to 3
  169. exit loop
  170. set {_pass} to 2
  171. if {_pass} is 2:
  172. send "&c裝備%name of clicked cursor% &c不符合玩家等級。"
  173. cancel event
  174. if {_pass} is 3:
  175. set {_lore::*} to uncolored lore of clicked cursor split at "||"#設定lore為所有的注釋
  176. loop {_lore::*}:#循環讀取所有lore一次
  177. if {_lore::%loop-index%} contains "-":
  178. replace all "-" and " " with "" in {_lore::%loop-index%}
  179. set {_save} to "%{_lore::%loop-index%}%"
  180. set {_save2} to "%{_save}%"
  181. loop 10 times:
  182. replace all "%loop-number - 1%" with "" in {_save}
  183. replace all "%{_save}%" with "" in {_save2}
  184. set {_save2} to {_save2} parsed as integer
  185. set {玩家資料.%player%::%{_save}%} to {玩家資料.%player%::%{_save}%} + {_save2}
  186. else:
  187. send "裝備介面只允許左鍵點擊"
  188. cancel event
  189. on mor.inventory click:
  190. wait 1 ticks
  191. if name of event-inventory contains "裝備介面":
  192. loop 54 times:
  193. if slot (loop-number - 1) of player's current inventory is a air:
  194. set slot (loop-number - 1) of player's current inventory to 1 of snow layer named "&f空白欄"
  195. on inventory close:
  196. if inventory name of player's current inventory contains "裝備介面":
  197. if name of slot 11 of player's current inventory isn't "&f空白欄":
  198. set {_number} to 1
  199. set {_slot} to 11
  200. if file existance of "plugins/equip/%player%/1.yml" is false:
  201. create file "plugins/equip/%player%/1.yml"
  202. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  203. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  204. if name of slot 11 of player's current inventory is "&f空白欄":
  205. df "plugins/equip/%player%/1.yml"
  206. if name of slot 20 of player's current inventory isn't "&f空白欄":
  207. set {_number} to 2
  208. set {_slot} to 20
  209. if file existance of "plugins/equip/%player%/2.yml" is false:
  210. create file "plugins/equip/%player%/2.yml"
  211. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  212. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  213. if name of slot 20 of player's current inventory is "&f空白欄":
  214. df "plugins/equip/%player%/2.yml"
  215. if name of slot 29 of player's current inventory isn't "&f空白欄":
  216. set {_number} to 3
  217. set {_slot} to 29
  218. if file existance of "plugins/equip/%player%/3.yml" is false:
  219. create file "plugins/equip/%player%/3.yml"
  220. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  221. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  222. if name of slot 29 of player's current inventory is "&f空白欄":
  223. df "plugins/equip/%player%/3.yml"
  224. if name of slot 38 of player's current inventory isn't "&f空白欄":
  225. set {_number} to 4
  226. set {_slot} to 38
  227. if file existance of "plugins/equip/%player%/4.yml" is false:
  228. create file "plugins/equip/%player%/4.yml"
  229. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  230. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  231. if name of slot 38 of player's current inventory is "&f空白欄":
  232. df "plugins/equip/%player%/4.yml"
  233. if name of slot 14 of player's current inventory isn't "&f空白欄":
  234. set {_number} to 5
  235. set {_slot} to 14
  236. if file existance of "plugins/equip/%player%/5.yml" is false:
  237. create file "plugins/equip/%player%/5.yml"
  238. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  239. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  240. if name of slot 14 of player's current inventory is "&f空白欄":
  241. df "plugins/equip/%player%/5.yml"
  242. if name of slot 16 of player's current inventory isn't "&f空白欄":
  243. set {_number} to 6
  244. set {_slot} to 16
  245. if file existance of "plugins/equip/%player%/6.yml" is false:
  246. create file "plugins/equip/%player%/6.yml"
  247. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  248. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  249. if name of slot 16 of player's current inventory is "&f空白欄":
  250. df "plugins/equip/%player%/6.yml"
  251. if name of slot 23 of player's current inventory isn't "&f空白欄":
  252. set {_number} to 7
  253. set {_slot} to 23
  254. if file existance of "plugins/equip/%player%/7.yml" is false:
  255. create file "plugins/equip/%player%/7.yml"
  256. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  257. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  258. if name of slot 23 of player's current inventory is "&f空白欄":
  259. df "plugins/equip/%player%/7.yml"
  260. if name of slot 25 of player's current inventory isn't "&f空白欄":
  261. set {_number} to 8
  262. set {_slot} to 25
  263. if file existance of "plugins/equip/%player%/8.yml" is false:
  264. create file "plugins/equip/%player%/8.yml"
  265. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  266. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  267. if name of slot 25 of player's current inventory is "&f空白欄":
  268. df "plugins/equip/%player%/8.yml"
  269. if name of slot 32 of player's current inventory isn't "&f空白欄":
  270. set {_number} to 9
  271. set {_slot} to 32
  272. if file existance of "plugins/equip/%player%/9.yml" is false:
  273. create file "plugins/equip/%player%/9.yml"
  274. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  275. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  276. if name of slot 32 of player's current inventory is "&f空白欄":
  277. df "plugins/equip/%player%/9.yml"
  278. if name of slot 34 of player's current inventory isn't "&f空白欄":
  279. set {_number} to 10
  280. set {_slot} to 34
  281. if file existance of "plugins/equip/%player%/10.yml" is false:
  282. create file "plugins/equip/%player%/10.yml"
  283. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  284. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  285. if name of slot 34 of player's current inventory is "&f空白欄":
  286. df "plugins/equip/%player%/10.yml"
  287. if name of slot 41 of player's current inventory isn't "&f空白欄":
  288. set {_number} to 11
  289. set {_slot} to 41
  290. if file existance of "plugins/equip/%player%/11.yml" is false:
  291. create file "plugins/equip/%player%/11.yml"
  292. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  293. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  294. if name of slot 41 of player's current inventory is "&f空白欄":
  295. df "plugins/equip/%player%/11.yml"
  296. if name of slot 43 of player's current inventory isn't "&f空白欄":
  297. set {_number} to 12
  298. set {_slot} to 43
  299. if file existance of "plugins/equip/%player%/12.yml" is false:
  300. create file "plugins/equip/%player%/12.yml"
  301. set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
  302. set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
  303. if name of slot 43 of player's current inventory is "&f空白欄":
  304. df "plugins/equip/%player%/12.yml"
  305.  
  306. command /resetequip:
  307. trigger:
  308. loop 12 times:
  309. set {_number} to loop-number
  310. df "plugins/equip/%player%/%{_number}%.yml"
Advertisement
Add Comment
Please, Sign In to add comment