7mm

【Skript】EasyRecipe

7mm
Jul 29th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. command /addrecipe <boolean> <text>:
  2. permission: skript.addrecipe
  3. aliases: /rcp+
  4. trigger:
  5. set {_i::0} to arg 2 parsed as item
  6. set {_slot} to -1
  7. loop all items in player's inventory:
  8. add 1 to {_slot}
  9. set {_i::%{_slot}%} to type of loop-item
  10. {_slot} is 8
  11. exit loop
  12. add 1 to {recipe-quant}
  13. set {recipe::%{recipe-quant}%::*} to {_i::*}
  14. if arg 1 is true:
  15. register new shapeless recipe for {_i::0} using {_i::1}, {_i::2}, {_i::3}, {_i::4}, {_i::5}, {_i::6}, {_i::7}, {_i::8}, {_i::9}
  16. message "&aID %{recipe-quant}% に不定形レシピを追加しました"
  17. set {recipe::%{recipe-quant}%::shapeless} to true
  18. stop
  19. register new shaped recipe for {_i::0} using {_i::1}, {_i::2}, {_i::3}, {_i::4}, {_i::5}, {_i::6}, {_i::7}, {_i::8}, {_i::9}
  20. message "&aID %{recipe-quant}% にレシピを追加しました"
  21.  
  22. command /recipelist [<integer>]:
  23. permission: skript.recipelist
  24. aliases: /rcpl
  25. trigger:
  26. set {_range-b} to 1
  27. set {_range-e} to 9
  28. set {_page} to floor((size of {_recipe::*} - 1)/9) + 1
  29. if arg 1 is set:
  30. set {_range-e} to arg 1 * 9
  31. set {_range-b} to {_range-e} - 8
  32. message "&e登録済みレシピのリスト(Page %arg 1%/%{_page}%)"
  33. loop {recipe::*}:
  34. add 1 to {_loop-number}
  35. if {_range-b} > {_loop-number}:
  36. continue loop
  37. if {recipe::%{recipe-quant}%::shapeless} is true:
  38. message "&eID %loop-index%&7: &6[Sharpless] &a%{recipe::%loop-index%::0}% &7... &f%{recipe::%loop-index%::1}%, %{recipe::%loop-index%::2}%, %{recipe::%loop-index%::3}%, %{recipe::%loop-index%::4}%, %{recipe::%loop-index%::5}%, %{recipe::%loop-index%::6}%, %{recipe::%loop-index%::7}%, %{recipe::%loop-index%::8}%, %{recipe::%loop-index%::9}%"
  39. else:
  40. message "&eID %loop-index%&7: &a%{recipe::%loop-index%::0}% &7... &f%{recipe::%loop-index%::1}%, %{recipe::%loop-index%::2}%, %{recipe::%loop-index%::3}%, %{recipe::%loop-index%::4}%, %{recipe::%loop-index%::5}%, %{recipe::%loop-index%::6}%, %{recipe::%loop-index%::7}%, %{recipe::%loop-index%::8}%, %{recipe::%loop-index%::9}%"
  41. if {_range-e} < {_loop-number}:
  42. exit loop
  43.  
  44. command /removerecipe <integer>:
  45. permission: skript.removerecipe
  46. aliases: /rcp-
  47. trigger:
  48. set {_i::*} to {recipe::%arg 1%::*}
  49. register new shaped recipe for air using {_i::1}, {_i::2}, {_i::3}, {_i::4}, {_i::5}, {_i::6}, {_i::7}, {_i::8}, {_i::9}
  50. clear {recipe::%arg 1%::*}
  51. clear {recipe::%arg 1%}
  52. message "&aID %{recipe-quant}% のレシピを削除しました"
Add Comment
Please, Sign In to add comment