Oxalist

Untitled

Feb 10th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. command /pwand:
  2. permission playerworldedit.use
  3. trigger:
  4. give player wooden axe named "&8» &7Player world edit &8»Very limited"
  5. send "&8» &7You have been given the World Edit wand" to player
  6.  
  7. On leftclick:
  8. player's tool is wooden axe named "&8» &7Player world edit &8»Very limited"
  9. cancel event
  10. clicked block is not air block
  11. set {we.pos2.x.%player%} to rounded down x coordinate of clicked block
  12. set {we.pos2.y.%player%} to rounded down y coordinate of clicked block
  13. set {we.pos2.z.%player%} to rounded down z coordinate of clicked block
  14. set {_exloc} to location of player
  15. set {_rx} to rounded down x coord of player
  16. set {_ry} to rounded down y coord of player
  17. set {_rz} to rounded down z coord of player
  18. set {_0x} to location of block {_rx} west of block at {_exloc}
  19. set {_0y} to location of block {_ry} below block at {_0x}
  20. set {_0.0.0} to location of block {_rz} north of block at {_0y}
  21. if {we.pos1.x.%player%} is set:
  22. if {we.pos1.x.%player%} is greater than {we.pos2.x.%player%}:
  23. set {_xmax} to 1
  24. set {_xmin} to 2
  25. else:
  26. set {_xmax} to 2
  27. set {_xmin} to 1
  28. if {we.pos1.y.%player%} is greater than {we.pos2.y.%player%}:
  29. set {_ymax} to 1
  30. set {_ymin} to 2
  31. else:
  32. set {_ymax} to 2
  33. set {_ymin} to 1
  34. if {we.pos1.z.%player%} is greater than {we.pos2.z.%player%}:
  35. set {_zmax} to 1
  36. set {_zmin} to 2
  37. else:
  38. set {_zmax} to 2
  39. set {_zmin} to 1
  40. clear {we.sel.%player%::*}
  41. loop integers between {we.pos%{_xmin}%.x.%player%} and {we.pos%{_xmax}%.x.%player%}:
  42. set {_curx} to location of block loop-integer-1 east of block at {_0.0.0}
  43. loop integers between {we.pos%{_ymin}%.y.%player%} and {we.pos%{_ymax}%.y.%player%}:
  44. set {_cury} to location of block loop-integer-2 above block at {_curx}
  45. loop integers between {we.pos%{_zmin}%.z.%player%} and {we.pos%{_zmax}%.z.%player%}:
  46. set {_final} to location of block loop-integer-3 south of block at {_cury}
  47. add {_final} to {we.sel.%player%::*}
  48. send "&dFirst position set to (%{we.pos2.x.%player%}%, %{we.pos2.y.%player%}%, %{we.pos2.z.%player%}%). (%size of {we.sel.%player%::*}%)" to player
  49. else:
  50. send "&dFirst position set to (%{we.pos2.x.%player%}%, %{we.pos2.y.%player%}%, %{we.pos2.z.%player%}%)." to player
  51.  
  52. On rightclick:
  53. player's tool is wooden axe named "&8» &7Player world edit &8»Very limited"
  54. cancel event
  55. clicked block is not air block
  56. set {we.pos1.x.%player%} to rounded down x coordinate of clicked block
  57. set {we.pos1.y.%player%} to rounded down y coordinate of clicked block
  58. set {we.pos1.z.%player%} to rounded down z coordinate of clicked block
  59. set {_exloc} to location of player
  60. set {_rx} to rounded down x coord of player
  61. set {_ry} to rounded down y coord of player
  62. set {_rz} to rounded down z coord of player
  63. set {_0x} to location of block {_rx} west of block at {_exloc}
  64. set {_0y} to location of block {_ry} below block at {_0x}
  65. set {_0.0.0} to location of block {_rz} north of block at {_0y}
  66. if {we.pos2.x.%player%} is set:
  67. if {we.pos1.x.%player%} is greater than {we.pos2.x.%player%}:
  68. set {_xmax} to 1
  69. set {_xmin} to 2
  70. else:
  71. set {_xmax} to 2
  72. set {_xmin} to 1
  73. if {we.pos1.y.%player%} is greater than {we.pos2.y.%player%}:
  74. set {_ymax} to 1
  75. set {_ymin} to 2
  76. else:
  77. set {_ymax} to 2
  78. set {_ymin} to 1
  79. if {we.pos1.z.%player%} is greater than {we.pos2.z.%player%}:
  80. set {_zmax} to 1
  81. set {_zmin} to 2
  82. else:
  83. set {_zmax} to 2
  84. set {_zmin} to 1
  85. clear {we.sel.%player%::*}
  86. loop integers between {we.pos%{_xmin}%.x.%player%} and {we.pos%{_xmax}%.x.%player%}:
  87. set {_curx} to location of block loop-integer-1 east of block at {_0.0.0}
  88. loop integers between {we.pos%{_ymin}%.y.%player%} and {we.pos%{_ymax}%.y.%player%}:
  89. set {_cury} to location of block loop-integer-2 above block at {_curx}
  90. loop integers between {we.pos%{_zmin}%.z.%player%} and {we.pos%{_zmax}%.z.%player%}:
  91. set {_final} to location of block loop-integer-3 south of block at {_cury}
  92. add {_final} to {we.sel.%player%::*}
  93. send "&dSecond position set to (%{we.pos1.x.%player%}%, %{we.pos1.y.%player%}%, %{we.pos1.z.%player%}%). (%size of {we.sel.%player%::*}%)" to player
  94. else:
  95. send "&dSecond position set to %{we.pos1.x.%player%}%, %{we.pos1.y.%player%}%, %{we.pos1.z.%player%}%)." to player
  96.  
  97. On break:
  98. player's tool is wooden axe named "&8» &7Player world edit &8»Very limited"
  99. cancel event
  100.  
  101. command //pset <itemtype>:
  102. trigger:
  103. if {we.sel.%player%::*} is not set:
  104. send "&cMake a region selection first!" to player
  105. stop
  106. loop {we.sel.%player%::*}:
  107. block at loop-value is not argument
  108. set block at loop-value to argument
  109. add 1 to {_change}
  110. send "&d%{_change}% block(s) changed." to player
  111.  
  112. command //pcut:
  113. trigger:
  114. if {we.sel.%player%::*} is not set:
  115. send "&cMake a region selection first!" to player
  116. stop
  117. loop {we.sel.%player%::*}:
  118. block at loop-value is not air
  119. set block at loop-value to air
  120. add 1 to {_change}
  121. send "&d%{_change}% block(s) changed." to player
Advertisement
Add Comment
Please, Sign In to add comment