Advertisement
BobMe

Minecraft ED // WorldEdit

Mar 14th, 2019
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.27 KB | None | 0 0
  1. // Script Made By PoisonGhost (819680_) [Ver. 1.0]
  2. // This disappointingly took 13 days.
  3.  
  4. // Prefix is ; for example, saying !cmds will not work, but ;cmds will.
  5.  
  6. // Current Commands :
  7. //---------
  8. // ;cmds
  9. // ;worldedit
  10. // ;destroy
  11. // ;fill id
  12. // ;replace id id
  13. // ;copy
  14. // ;paste
  15. // ;follow
  16. // ;stay
  17. //---------
  18. // id means block id, for example ";fill 2" would fill a zone with grass blocks.
  19.  
  20. // To use worldedit, say ;worldedit to enable it, then use a NON DAMAGED wooden pickaxe to set a zone.
  21.  
  22.  
  23. let toggle = false
  24. let pos: Position = null
  25. let tf = false
  26. let worldedit = false
  27. let initpos: Position = null
  28. let follow = false
  29. let msg = 0
  30. let blocker: Block = null
  31. let wepos1: Position = null
  32. let wepos2: Position = null
  33. let copos1: Position = null
  34. let copos2: Position = null
  35. let pos7: Position = null
  36. let pos1: Position = null
  37. let pos2: Position = null
  38. let pos3: Position = null
  39. let pos4: Position = null
  40. let pos5: Position = null
  41. let pos6: Position = null
  42. let canarrow = 0
  43. let horain = false
  44. player.onChat(";stay", function () {
  45. follow = false
  46. })
  47. blocks.onBlockBroken(blocks.block(Block.Sign), function () {
  48. if (tf == true) {
  49. if (blocks.testForBlock(blocks.block(Block.Air), pos1)) {
  50. pos = pos1
  51. } else if (blocks.testForBlock(blocks.block(Block.Air), pos2)) {
  52. pos = pos2
  53. } else if (blocks.testForBlock(blocks.block(Block.Air), pos3)) {
  54. pos = pos3
  55. } else if (blocks.testForBlock(blocks.block(Block.Air), pos4)) {
  56. pos = pos4
  57. } else if (blocks.testForBlock(blocks.block(Block.Air), pos5)) {
  58. pos = pos5
  59. } else if (blocks.testForBlock(blocks.block(Block.Air), pos6)) {
  60. pos = pos6
  61. } else if (blocks.testForBlock(blocks.block(Block.Air), pos7)) {
  62. pos = pos7
  63. }
  64. wipesigns2222()
  65. if (pos == pos1) {
  66. tpagent2222()
  67. player.say("§dAgent teleported to your position")
  68. } else if (pos == pos2) {
  69. player.say("§dSurfacing...")
  70. surface2222()
  71. } else if (pos == pos3) {
  72. player.say("§dLighting the area...")
  73. light2222()
  74. } else if (pos == pos4) {
  75. player.say("§dExcavating..")
  76. mine222()
  77. } else if (pos == pos5) {
  78. player.say("§4§lLook up...")
  79. horsspawn()
  80. } else if (pos == pos6) {
  81. player.execute("xp 1L @s")
  82. player.say("§dGained XP.")
  83. } else if (pos == pos7) {
  84. player.say("§d§dRemoving dropped items.")
  85. clean()
  86. }
  87. }
  88. })
  89.  
  90.  
  91. // player.onChat(";select", function () { if
  92. // (worldedit == true) { selectBlock() } else {
  93. // player.say("Error: WorldEdit disabled") } })
  94. player.onChat(";fill", function (num1: number) {
  95. if (worldedit == true && wepos1 != null && wepos2 != null) {
  96. filler(num1)
  97. player.say("§2Blocks filled.")
  98. } else if (worldedit == true && wepos1 == null && wepos2 == null) {
  99. player.say("§4Error:§d Invalid zone.")
  100. } else {
  101. player.say("§4Error:§d WorldEdit disabled")
  102. }
  103. })
  104. player.onChat(";replace", function (num1: number, num2: number) {
  105. if (worldedit == true && wepos1 != null && wepos2 != null) {
  106. replacer(num1, num2)
  107. player.say("§2§dBlocks replaced.")
  108. } else if (worldedit == true && wepos1 == null && wepos2 == null) {
  109. player.say("§4Error:§d Invalid zone.")
  110. } else {
  111. player.say("§4Error:§d WorldEdit disabled")
  112. }
  113. })
  114. player.onChat(";copy", function () {
  115. if (worldedit == true && wepos1 != null && wepos2 != null) {
  116. copyy()
  117. player.say("§dSelection Copied.")
  118. } else if (worldedit == true && wepos1 == null && wepos2 == null) {
  119. player.say("§4Error:§d Invalid zone.")
  120. } else {
  121. player.say("§4Error:§d WorldEdit disabled")
  122. }
  123. })
  124. player.onChat(";paste", function () {
  125. if (worldedit == true && wepos1 != null && wepos2 != null) {
  126. pastey()
  127. player.say("§dSelection Pasted.")
  128. } else if (worldedit == true && wepos1 == null && wepos2 == null) {
  129. player.say("§4Error:§d Invalid zone.")
  130. } else {
  131. player.say("§4Error:§d WorldEdit disabled")
  132. }
  133. })
  134. player.onChat(";destroy", function () {
  135. if (worldedit == true) {
  136. dodestroy22()
  137. } else {
  138. player.say("§4Error:§d WorldEdit disabled")
  139. }
  140. })
  141. player.onItemInteracted(blocks.item(Item.WoodenPickaxe), function () {
  142. if (worldedit == true) {
  143. if (toggle == false) {
  144. player.say("§1Position 1 set:§d (" + player.position().add(positions.create(0, -1, 0)) + ")")
  145. if (wepos1 != null && blocks.testForBlock(blocks.block(Block.BlackStainedGlass), wepos1)) {
  146. blocks.place(0, wepos1)
  147. }
  148. wepos1 = player.position().add(positions.create(0, -1, 0))
  149. blocks.place(blocks.block(Block.BlackStainedGlass), wepos1)
  150. toggle = true
  151. } else {
  152. player.say("§1Position 2 set:§d (" + player.position().add(positions.create(0, -1, 0)) + ")")
  153. if (wepos2 != null && blocks.testForBlock(blocks.block(Block.BlueStainedGlass), wepos2)) {
  154. blocks.place(0, wepos2)
  155. }
  156. wepos2 = player.position().add(positions.create(0, -1, 0))
  157. blocks.place(blocks.block(Block.BlueStainedGlass), wepos2)
  158. toggle = false
  159. }
  160. }
  161. })
  162. player.onChat(";worldedit", function () {
  163. if (worldedit == false) {
  164. worldedit = true
  165. player.say("§dWorldEdit enabled")
  166. } else {
  167. worldedit = false
  168. player.say("§dWorldEdit disabled")
  169. }
  170. })
  171. function light2222() {
  172. blocks.fill(
  173. blocks.block(Block.Torch),
  174. positions.create(-2, 0, -2),
  175. positions.create(2, 0, 2),
  176. FillOperation.Outline
  177. )
  178. }
  179.  
  180.  
  181. function horsspawn() {
  182. for (let i = 0; i < 150; i++) {
  183. mobs.spawn(mobs.animal(AnimalMob.Horse), positions.create(0, 150, 0))
  184. }
  185. }
  186. player.onChat(";follow", function (msg) {
  187. follow = true
  188. })
  189. player.onChat(";select", function (num1, num2, num3) {
  190. if (worldedit == true) {
  191. blocker = blocks.blockById(num1)
  192. player.say("§1Block Selected: §d" + blocks.block(blocker))
  193. } else {
  194. player.say("§4Error:§d WorldEdit Disabled")
  195. }
  196. })
  197. loops.forever(function () {
  198. if (follow == true) {
  199. loops.pause(200)
  200. tpagent2222()
  201. } else {
  202. loops.pause(200)
  203. }
  204. })
  205. function dodestroy22() {
  206. if (wepos1 != null && wepos2 != null) {
  207. blocks.fill(
  208. blocks.block(Block.Air),
  209. wepos2,
  210. wepos1,
  211. FillOperation.Replace
  212. )
  213. player.say("§dZone removed")
  214. } else {
  215. player.say("§4Error:§d Invalid zone")
  216. }
  217. }
  218. function tpagent2222() {
  219. agent.teleport(positions.create(1, 0, 1), CompassDirection.West)
  220. }
  221. function mine222() {
  222. blocks.replace(
  223. blocks.block(Block.Air),
  224. blocks.block(Block.Stone),
  225. positions.create(-10, 5, -10),
  226. positions.create(10, 0, 10)
  227. )
  228. blocks.replace(
  229. blocks.block(Block.Air),
  230. blocks.block(Block.Granite),
  231. positions.create(-10, 5, -10),
  232. positions.create(10, 0, 10)
  233. )
  234. blocks.replace(
  235. blocks.block(Block.Air),
  236. blocks.block(Block.Diorite),
  237. positions.create(-10, 5, -10),
  238. positions.create(10, 0, 10)
  239. )
  240. blocks.replace(
  241. blocks.block(Block.Air),
  242. blocks.block(Block.Gravel),
  243. positions.create(-10, 5, -10),
  244. positions.create(10, 0, 10)
  245. )
  246. blocks.replace(
  247. blocks.block(Block.Air),
  248. blocks.block(Block.Andesite),
  249. positions.create(-10, 5, -10),
  250. positions.create(10, 0, 10)
  251. )
  252. blocks.replace(
  253. blocks.block(Block.Air),
  254. blocks.block(Block.Water),
  255. positions.create(-10, 5, -10),
  256. positions.create(10, 0, 10)
  257. )
  258. }
  259. function surface2222() {
  260. player.teleport(positions.createHybrid("~", "66", "~"))
  261. blocks.place(blocks.block(Block.Grass), positions.create(0, -1, 0))
  262. blocks.fill(0, positions.create(0, 1, 0), positions.create(0, 0, 0))
  263. }
  264. function wipesigns2222() {
  265. blocks.fill(0, pos1, pos7)
  266. tf = false
  267. }
  268. player.onChat(";cmds", function (msg) {
  269. initpos = player.position()
  270. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(3, 0, -2)))
  271. pos1 = initpos.add(positions.create(3, 0, -2))
  272. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(2, 0, -2)))
  273. pos2 = initpos.add(positions.create(2, 0, -2))
  274. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(1, 0, -2)))
  275. pos3 = initpos.add(positions.create(1, 0, -2))
  276. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(0, 0, -2)))
  277. pos4 = initpos.add(positions.create(0, 0, -2))
  278. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-1, 0, -2)))
  279. pos5 = initpos.add(positions.create(-1, 0, -2))
  280. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-2, 0, -2)))
  281. pos6 = initpos.add(positions.create(-2, 0, -2))
  282. blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-3, 0, -2)))
  283. pos7 = initpos.add(positions.create(-3, 0, -2))
  284. tf = true
  285. })
  286.  
  287. function filler(num1: number) {
  288. if (wepos1 != null && wepos2 != null && num1 == 0) {
  289. blocks.fill(
  290. blocks.block(blocker),
  291. wepos2,
  292. wepos1,
  293. FillOperation.Replace
  294. )
  295. } else if (blocker == null && wepos1 != null && wepos2 != null && num1 == 0) {
  296. player.say("§4Error:§d No Block Selected")
  297. } else if (wepos1 != null && wepos2 != null && num1 != 0) {
  298. blocks.fill(
  299. blocks.blockById(num1),
  300. wepos2,
  301. wepos1,
  302. FillOperation.Replace
  303. )
  304.  
  305. } else {
  306.  
  307. }
  308. }
  309. function replacer(num2: number, num1: number) {
  310. if (wepos1 != null && wepos2 != null && num1 == 0) {
  311. blocks.replace(
  312. blocks.blockById(num1),
  313. blocks.blockById(num2),
  314. wepos1,
  315. wepos2
  316. )
  317. } else if (blocker == null && wepos1 != null && wepos2 != null && num1 == 0) {
  318. player.say("§4Error:§d No Block Selected")
  319. } else if (wepos1 != null && wepos2 != null && num1 != 0) {
  320. blocks.replace(
  321. blocks.blockById(num1),
  322. blocks.blockById(num2),
  323. wepos1,
  324. wepos2
  325. )
  326. } else {
  327. }
  328. }
  329.  
  330. function copyy() {
  331. if (wepos1 != null && wepos2 != null) {
  332. copos1 = wepos1
  333. copos2 = wepos2
  334. } else {
  335. player.say("§4Error:§d Invalid Zone")
  336. }
  337. }
  338.  
  339. function pastey() {
  340. blocks.clone(copos1, copos2, player.position(), CloneMask.Masked, CloneMode.Normal)
  341. }
  342.  
  343. function clean() {
  344. player.execute("kill @e [type=item]")
  345. }
  346.  
  347. player.execute(
  348. "title @s title §3PoisonGhost's Sign UI Loaded"
  349. )
  350.  
  351. player.execute(
  352. "title @s subtitle §4Say §1;cmds§4 for signs to appear"
  353. )
  354.  
  355. player.say("§3PoisonGhost (819680_)'s dumb sign UI loaded.")
  356. player.say("§dSay§1 ;cmds§d for signs to appear")
  357. player.say("§dSay§1 ;worldedit§d to use worldedit")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement