Advertisement
therasmusgamer

Untitled

Aug 1st, 2019
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. command /spawner [<text>] [<player>]:
  2. trigger:
  3. if sender is the console:
  4. if arg-1 is not set:
  5. send "&cUsage: /spawner <spawner-type> [player]"
  6. else if arg-2 is not set:
  7. set {_item} to mob spawner named "&c%arg-1% Spawner"
  8. add {_item} to player's inventory
  9. send "&fYou've been given a spawner: &c%arg-1% Spawner"
  10. else:
  11. set {_item} to mob spawner named "&c%arg-1% Spawner"
  12. add {_item} to arg-2's inventory
  13. send "&fSuccessfully gave %arg-1% a spawner: &c%arg-1% Spawner" to sender
  14. send "&fYou've been given a spawner: &c%arg-1% Spawner" to arg-2
  15. else if player has permission "Staff.Spawner":
  16. if arg-1 is not set:
  17. send "&cUsage: /spawner <spawner-type> [player]"
  18. else if arg-2 is not set:
  19. set {_item} to mob spawner named "&c%arg-1% Spawner"
  20. add {_item} to player's inventory
  21. send "&fYou've been given a spawner: &c%arg-1% Spawner"
  22. else:
  23. set {_item} to mob spawner named "&c%arg-1% Spawner"
  24. add {_item} to arg-2's inventory
  25. send "&fSuccessfully gave %arg-2% a spawnwer: &c%arg-1% Spawner" to sender
  26. send "&fYou've been given a spawner: &c%arg-1% Spawner" to arg-2
  27.  
  28. on place:
  29. if player's tool is mob spawner:
  30. set {_name} to player's tool's name
  31. set {_name} to uncoloured {_name}
  32. set {_type::*} to split {_name} at " "
  33. if {_type::3} is set:
  34. set {_name} to "%{_type::1}%_%{_type::2}%"
  35. set {_namee} to "%{_type::1}% %{_type::2}%"
  36. else:
  37. set {_name} to {_type::1}
  38. set {_namee} to {_type::1}
  39. set entity type of spawner at event-block to {_name}
  40. send "&fYou placed a spawner: &c%{_namee}% Spawner"
  41. on break:
  42. if event-block is mob spawner:
  43. if player's tool is pickaxe:
  44. if player's tool is enchanted with silk touch:
  45. set dropped exp orbs to 0
  46. set {_name} to event-block's spawner entity type
  47. set {_type::*} to split {_name} at "_"
  48. set {_String} to the 1 first characters of {_name}
  49. set {_String} to {_String} in upper case
  50. set {_l} to the length of {_type::1}
  51. set {_w} to the ({_l} - 1) last characters of {_type::1}
  52. set {_result} to "%{_String}%%{_w}%"
  53. replace all "_" in {_name} with " "
  54. if {_type::2} is set:
  55. set {_String1} to the 1 first characters of {_type::2}
  56. set {_String1} to {_String1} in upper case
  57. set {_l1} to length of {_type::2}
  58. set {_w1} to the ({_l1} - 1) last characters of {_type::2}
  59. set {_result1} to "%{_String1}%%{_w1}%"
  60. if {_result1} is not set:
  61. set {_item} to 1 mob spawner named "&c%{_result}% Spawner"
  62. else:
  63. set {_item} to 1 mob spawner named "&c%{_result}% %{_result1}% Spawner"
  64. drop {_item} at event-location
  65. on spawn:
  66. loop entities in radius 5 around event-entity:
  67. if loop-entity is not a player:
  68. if loop-entity is not an item:
  69. if "%loop-value%" = "%event-entity%":
  70. cancel event
  71. if {Stacked.%loop-entity's uuid%} is not set:
  72. add 1 to {Stacked.%loop-entity's uuid%}
  73. add 1 to {Stacked.%loop-entity's uuid%}
  74. add "{CustomName:""{\""text\"":\""&l&cStack (%{Stacked.%loop-entity's uuid%}%x)\""}"",CustomNameVisible:1}" to nbt of loop-entity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement