XximrglopxX

WorldEdit MakeCode edition v1.0

Jun 16th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // win10 code connection worldedit? Currently it is somewhat buggy. Bedrock edition.
  2. // version 1.1 check back for updates
  3. // this is nowhere close to the actual worldedit mainly because it won't let me add string parameters to chat commands rip also explains why there are 700 lines of code wth
  4. // turn on Education Features for full experience
  5.  
  6. // VERSION 1.1 NEW UPDATE MORE BLOCKS ADDED (MAYBE) AND /RG EXPAND ADDED
  7.  
  8. // win10 code connection worldedit? Currently it is somewhat buggy. Bedrock edition.
  9. // version 1.0 check back for updates
  10. // this is nowhere close to the actual worldedit mainly because it won't let me add string parameters to chat commands rip also explains why there are 700 lines of code wth
  11. // turn on Education Features for full experience
  12.  
  13. let pos1 = "0 1 0"
  14. let pos2 = "0 1 0"
  15. let block = "stone"
  16. let id = 0
  17. let mode = "fill"
  18. let muted = false
  19. let posit = 1
  20. let replacemode = false
  21. let version = "1.1"
  22. let brush = "stone"
  23. let brushid = 0
  24.  
  25. // by Imrglop
  26.  
  27. // not actual worldedit
  28.  
  29.  
  30.  
  31. player.execute('/tag @s add Admin')
  32.  
  33.  
  34.  
  35. function output(text: string) {
  36.     player.execute('tellraw @s {"rawtext":[{"text":"§8§l(§4FAWE§8)§r§7 '+text+'"}]}')
  37. }
  38.  
  39. function run(text: string) {
  40.     player.execute(text)
  41. }
  42.  
  43. player.onChat("//help", function(){
  44.     output("Commands:")
  45.     output("    Blocks:")
  46.     output("    //set-(block) (tile id)\n//sphere (rad)\n//feed\n//feed-all\n//clearlag\n//bringAgnet\n//replacemode")
  47. })
  48.  
  49. player.onChat("//bringAgent", function () {
  50.     agent.teleportToPlayer()
  51. })
  52.  
  53. player.onChat("//speed", function (speednum) {
  54.     output("Speed updated to "+speednum)
  55.     run(`effect @s speed 10000 ${speednum} true`)
  56. })
  57.    
  58. player.onChat("//smite", function () {
  59.     outputAll("Thou hast been smitten!")
  60.     player.execute("execute @a ~ ~ ~ summon lightning_bolt")
  61. })
  62.  
  63. function outputAll(text: string) {
  64.     player.execute('tellraw @a {"rawtext":[{"text":"§8§l(§4FAWE§8)§r§7 '+text+'"}]}')
  65. }
  66.  
  67. function handler () {
  68.     if (mode == "fill") {
  69.         if (replacemode == false) {
  70.             player.execute(
  71.                 `fill ${pos1} ${pos2} ${block} ${id}`
  72.             )
  73.         }
  74.         if (replacemode == true) {
  75.             player.execute(
  76.                 `fill ${pos1} ${pos2} ${block} ${id} replace air`
  77.             )
  78.         }
  79.     }
  80.     if (mode == "fill-force") {
  81.         run(`fill ${pos1} ${pos2} ${block} ${id}`)
  82.     }
  83.  
  84.     if (mode == "fill-replace") {
  85.         player.execute(
  86.         `fill ${pos1} ${pos2} ${block} ${id} replace air`
  87.         )
  88.     }
  89. }
  90.  
  91.  
  92. // BOOKMARK DOG CAT TREE TRAIN FAST
  93.  
  94. player.onChat("//add", function(item, item2) {
  95.     outputAll(`Result: ${item+item2}`)
  96. })
  97.  
  98. player.onChat("//rg-expand", function() {
  99.     pos1 = `${pos1.split(" ")[0]} 255 ${pos1.split(" ")[2]}`
  100.    
  101.     pos2 = `${pos2.split(" ")[0]} 0 ${pos2.split(" ")[2]}`
  102.    
  103.     output("The region has been expanded. (to Y level 255 and 0)")
  104. })
  105.  
  106. player.onChat("//region-expand", function() {
  107.     pos1 = `${pos1.split(" ")[0]} 255 ${pos1.split(" ")[2]}`
  108.    
  109.     pos2 = `${pos2.split(" ")[0]} 0 ${pos2.split(" ")[2]}`
  110.    
  111.     output("The region has been expanded. (to Y level 255 and 0)")
  112. })
  113.  
  114. player.onChat("//multiply", function(item, item2) {
  115.     outputAll(`Result: ${item*item2}`)
  116. })
  117.  
  118. player.onChat("//divide", function(item, item2) {
  119.     outputAll(`Result: ${item/item2}`)
  120. })
  121.  
  122. player.onChat("//subtract", function(item, item2) {
  123.     outputAll(`Result: ${item-item2}`)
  124. })
  125.  
  126. player.onChat("//set-netherbrick", function (tile_id) {
  127.     id = tile_id
  128.     mode = "fill"
  129.     block = "nether_bricks"
  130.     output(`Setting to ${block} (Tile ID:${tile_id})`)
  131.     handler()
  132. })
  133.  
  134. player.onChat("//set-gold", function (tile_id) {
  135.     id = tile_id
  136.     mode = "fill"
  137.     block = "gold_block"
  138.     output(`Setting to ${block} (Tile ID:${tile_id})`)
  139.     handler()
  140. })
  141.  
  142. player.onChat("//set-iron", function (tile_id) {
  143.     id = tile_id
  144.     mode = "fill"
  145.     block = "iron_block"
  146.     output(`Setting to ${block} (Tile ID:${tile_id})`)
  147.     handler()
  148. })
  149.  
  150. player.onChat("//set-emerald", function (tile_id) {
  151.     id = tile_id
  152.     mode = "fill"
  153.     block = "emerald_block"
  154.     output(`Setting to ${block} (Tile ID:${tile_id})`)
  155.     handler()
  156. })
  157.  
  158. player.onChat("//set-lapis", function (tile_id) {
  159.     id = tile_id
  160.     mode = "fill"
  161.     block = "lapis_block"
  162.     output(`Setting to ${block} (Tile ID:${tile_id})`)
  163.     handler()
  164. })
  165.  
  166. ///
  167.  
  168. player.onChat("//cut", function() {
  169.     output("Cutting!")
  170.     id = 0
  171.     mode = "fill-force"
  172.     block = "air"
  173.     output("Setting to air.")
  174.     handler()
  175. })
  176.  
  177. player.onChat("//tpall", function() {
  178.     outputAll("TP ALL!")
  179.     player.execute("tp @a @s")
  180. })
  181.  
  182. player.onChat("//checkgamemode", function() {
  183.     player.execute("say creative mode: @a[m=c]")
  184.     player.execute("say survival mode: @a[m=s]")
  185.     player.execute("say adventure mode: @a[m=a]")
  186. })
  187.  
  188. player.onChat("//undo", function() {
  189.     if (mode == "fill-replace" || replacemode == true) {
  190.         output("Undo-ing REPLACE only.")
  191.  
  192.         run(`fill ${pos1} ${pos2} air 0 replace ${block} ${id}`)
  193.        
  194.     } else {
  195.         output("§cCannot undo as the current mode is not fill-replace.§7 Do //replacemode to make it so it only replaces air and turn it to fill-replace.")
  196.     }
  197. })
  198.  
  199. player.onChat("//up", function (num) {
  200.     player.execute("tp ~ ~"+(num+1)+" ~")
  201.     player.execute("setblock ~ ~-1 ~ glass")
  202.     output("Going up "+num)
  203. })
  204.  
  205. player.onChat("/f", function() {
  206.     outputAll("Press f to pay respects")
  207.     player.execute("execute @a ~ ~ ~ say f")
  208. })
  209.  
  210. player.onChat("//replacemode", function() {
  211.     if (replacemode == false) {
  212.         output("Enabling Replace Mode.")
  213.         replacemode = true
  214.     } else {
  215.         output("Disabling Replace Mode.")
  216.         replacemode = false
  217.     }
  218. })
  219.  
  220. player.onChat("//drain", function(dr) {
  221.     if (dr == 0) {dr = 10}
  222.     output("Draining " +dr)
  223.     player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace water`)
  224.     player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace flowing_water`)
  225.     player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace lava`)
  226.     player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace flowing_lava`)
  227. })
  228.  
  229. player.onChat("//set-cobble", function () {
  230.     id = 0
  231.     mode = "fill"
  232.     block = "Cobblestone"
  233.     output("Setting to Cobblestone.")
  234.     handler()
  235. })
  236.  
  237. player.onChat("//set-quartz", function (tile_id) {
  238.     id = tile_id
  239.     mode = "fill"
  240.     block = "quartz_block"
  241.     output("Setting to quartz.")
  242.     handler()
  243. })
  244.  
  245.  
  246.  
  247. player.onChat("//set-smoothstone", function (tile_id) {
  248.     id = tile_id
  249.     mode = "fill"
  250.     block = "smooth_stone"
  251.     output("Setting to Smooth Stone.")
  252.     handler()
  253. })
  254.  
  255. player.onChat("//set-glass", function (tile_id) {
  256.     id = tile_id
  257.     mode = "fill"
  258.     block = "glass"
  259.     output("Setting to glass.")
  260.     handler()
  261. })
  262.  
  263. player.onChat("//set-stainedglass", function (tile_id) {
  264.     id = tile_id
  265.     mode = "fill"
  266.     block = "stained_glass"
  267.     output("Setting to stained glass.")
  268.     handler()
  269. })
  270.  
  271. player.onChat("//set-stonebrick", function () {
  272.     id = 0
  273.     mode = "fill"
  274.     block = "stonebrick"
  275.     output("Setting to Stone Bricks.")
  276.     handler()
  277. })
  278.  
  279. player.onChat("//set-stone", function (tile_id) {
  280.     id = tile_id
  281.     mode = "fill"
  282.     block = "stone"
  283.     output("Setting to Stone.")
  284.     handler()
  285. })
  286.  
  287. // decorative block
  288.  
  289. player.onChat("//set-bed", function (tile_id) {
  290.     id = tile_id
  291.     mode = "fill"
  292.     block = "bed"
  293.     output(`Setting to ${block}.`)
  294.     handler()
  295. })
  296.  
  297.  
  298. player.onChat("//brush", function () {
  299.     player.execute("give @p stone_shovel 1 0")
  300.     output("Given brush.")
  301. })
  302.  
  303. player.onChat("//brush-stone", function (tile_id) {
  304.     brush = "stone"
  305.     brushid = tile_id
  306.     output(`Set brush to stone (Tile ID: ${tile_id}).`)
  307. })
  308.  
  309.  
  310. player.onItemInteracted(STONE_SHOVEL, function () {
  311.     mode = "fill-replace"
  312.     block = brush
  313.     if (brush == "air") {
  314.         player.execute(`fill ^3 ^ ^10  ^-3 ^6 ^10 ${brush} ${brushid}`)
  315.     }
  316.     player.execute(`fill ^3 ^ ^10  ^-3 ^6 ^10 ${brush} ${brushid} replace air`)
  317.     player.execute(`fill ^3 ^ ^10  ^-3 ^6 ^10 ${brush} ${brushid} replace water`)
  318.  
  319.    
  320. })
  321.  
  322.  
  323. player.onChat("//brush-dirt", function (tile_id) {
  324.     brush = "stone"
  325.     brushid = tile_id
  326.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  327. })
  328.  
  329. player.onChat("//brush-grass", function (tile_id) {
  330.     brush = "grass"
  331.     brushid = tile_id
  332.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  333. })
  334. player.onChat("//brush-gravel", function (tile_id) {
  335.     brush = "gravel"
  336.     brushid = tile_id
  337.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  338. })
  339. player.onChat("//brush-sand", function (tile_id) {
  340.     brush = "sand"
  341.     brushid = tile_id
  342.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  343. })
  344.  
  345. player.onChat("//brush-air", function (tile_id) {
  346.     brush = "air"
  347.     brushid = tile_id
  348.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  349. })
  350.  
  351. player.onChat("//brush-sand", function (tile_id) {
  352.     brush = "sand"
  353.     brushid = 0
  354.     output(`Set brush to ${brush} (ID: ${tile_id}).`)
  355. })
  356.  
  357. player.onChat("//set-pistonarmcollision", function () {
  358.     id = 0
  359.     mode = "fill"
  360.     block = "pistonarmcollision"
  361.     output("Setting to Piston Arm Collision.")
  362.     handler()
  363. })
  364.  
  365. player.onChat("//set-stickypistonarmcollision", function () {
  366.     id = 0
  367.  
  368.     mode = "fill"
  369.     block = "stickypistonarmcollision"
  370.     output("Setting to Sticky Piston Arm Collision.")
  371.     handler()
  372. })
  373.  
  374. player.onChat("//set-farm", function (idt) {
  375.     id = idt
  376.  
  377.     mode = "fill"
  378.     block = "Farmland"
  379.     output("Setting to Farmland.")
  380.     handler()
  381. })
  382.  
  383. player.onChat("//tickingarea", function (idt) {
  384.     player.execute("tickingarea add "+pos1+" 0 "+pos2+" 0 "+" WorldEdit_TickArea +Math.randomRange(10000, 99999)")
  385.     output("Ticking area.")
  386.    
  387. })
  388.  
  389. player.onChat("//clearchat", function (idt) {
  390.     outputAll("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
  391.     outputAll("Chat cleared.")
  392.    
  393. })
  394.  
  395. player.onChat("//warn", function () {
  396.     player.execute('tellraw @p[rm=3] {"rawtext":[{"text":"§eYou have been warned. Please do not break the rules again."}]}')
  397.     player.execute("execute @p[rm=3] ~ ~ ~ summon lightning_bolt")
  398.     player.execute('say §e @p[rm=3]§6 was warned.')
  399. })
  400.  
  401. player.onChat("//plant-wheat", function (idt) {
  402.     id = 7
  403.  
  404.     mode = "fill"
  405.     block = "wheat"
  406.     output("Plant wheat.")
  407.     handler()
  408. })
  409.  
  410. player.onChat("//light", function (idt) {
  411.     id = idt
  412.  
  413.     mode = "fill-replace"
  414.     block = "light_block"
  415.     output("Light.")
  416.     handler()
  417. })
  418.  
  419. player.onChat("//set-water", function () {
  420.     id = 0
  421.  
  422.     mode = "fill"
  423.     block = "Water"
  424.     output("Setting to water.")
  425.     handler()
  426. })
  427.  
  428. player.onChat("//set-lava", function () {
  429.     id = 0
  430.  
  431.     mode = "fill"
  432.     block = "lava"
  433.     output("Setting to water.")
  434.     handler()
  435. })
  436.  
  437.  
  438. player.onChat("/pvp-allow", function () {
  439.     player.execute("gamerule pvp true")
  440.     outputAll("Global Flag PVP has been set to ALLOW")
  441. })
  442.  
  443. player.onChat("/pvp-deny", function () {
  444.     player.execute("gamerule pvp false")
  445.     outputAll("Global Flag PVP has been set to DENY")
  446. })
  447.  
  448. player.onChat("/build-deny", function () {
  449.     player.execute("immutableworld true")
  450.     outputAll("Global Flag build has been set to DENY")
  451.     run("ability @a[tag=Admin] worldbuilder true")
  452. })
  453.  
  454. player.onChat("/build-allow", function () {
  455.     player.execute("immutableworld false")
  456.     outputAll("Global Flag build has been set to ALLOW")
  457. })
  458.  
  459. player.onChat("//stash", function () {
  460.     id = 0
  461.  
  462.     mode = "fill"
  463.     block = "chest"
  464.     output("Stash formed.")
  465.     handler()
  466. })
  467.  
  468. player.onChat("//stash-hopper", function () {
  469.     id = 4
  470.  
  471.     mode = "fill"
  472.     block = "hopper"
  473.     output("Stash formed.")
  474.     handler()
  475. })
  476.  
  477. player.onChat("//set-treewood", function (tile_id) {
  478.     id = tile_id
  479.     mode = "fill"
  480.     block = "log"
  481.     output("Setting to log.")
  482.     handler()
  483. })
  484.  
  485.  
  486. player.onChat("//set-concrete", function (tile_id) {
  487.     id = tile_id
  488.  
  489.     mode = "fill"
  490.     block = "concrete"
  491.     output("Setting to Concrete.")
  492.     handler()
  493. })
  494.  
  495.  
  496. player.onChat("//set-wool", function (tile_id) {
  497.     id = tile_id
  498.  
  499.     mode = "fill"
  500.     block = "wool"
  501.     output("Setting to Wool.")
  502.     handler()
  503. })
  504.  
  505. player.onChat("//set-bricks", function (tile_id) {
  506.     id = tile_id
  507.  
  508.     mode = "fill"
  509.     block = "brick_block"
  510.     output("Setting to bricks.")
  511.     handler()
  512. })
  513.  
  514. player.onChat("//kit-pvp", function() {
  515.     run("replaceitem entity @s slot.armor.head 0 iron_helmet")
  516.     run("replaceitem entity @s slot.armor.chest 0 iron_chestplate")
  517.     run("replaceitem entity @s slot.armor.legs 0 iron_leggings")
  518.     run("replaceitem entity @s slot.armor.feet 0 iron_boots")
  519.  
  520.     run("give @s iron_sword 1")
  521.     run("give @s golden_apple 8")
  522.     run("give @s bow 1")
  523.     run("give @s arrow 16")
  524. })
  525.  
  526. player.onChat("//set-diamond", function (tile_id) {
  527.     id = tile_id
  528.  
  529.     mode = "fill"
  530.     block = "Diamond_Block"
  531.     output("Setting to diamond.")
  532.     handler()
  533. })
  534.  
  535. player.onChat("//barrierify", function (tile_id) {
  536.     id = tile_id
  537.  
  538.     mode = "fill-replace"
  539.     block = "barrier"
  540.     output("Replacing air to barrier.")
  541.     handler()
  542. })
  543.  
  544.  
  545. player.onChat("//set-dirt", function (tile_id) {
  546.     id = tile_id
  547.  
  548.     mode = "fill"
  549.     block = "dirt"
  550.     output("Setting to Dirt.")
  551.     handler()
  552. })
  553.  
  554. player.onChat("//set-gravel", function (tile_id) {
  555.     id = tile_id
  556.  
  557.     mode = "fill"
  558.     block = "gravel"
  559.     output("Setting to Gravel.")
  560.     handler()
  561. })
  562.  
  563.  
  564. player.onChat("gm/c", function () {
  565.     output("Setting gamemode to creative")
  566.     player.execute("gamemode 1")
  567. })
  568.  
  569. player.onChat("gm/s", function () {
  570.     output("Setting gamemode to survival")
  571.     player.execute("gamemode 0")
  572. })
  573.  
  574. player.onChat("//set-air", function () {
  575.     id = 0
  576.  
  577.     mode = "fill-force"
  578.     block = "air"
  579.     output("Setting to air.")
  580.     handler()
  581. })
  582.  
  583. player.onChat("//set-terracotta", function (tile_id) {
  584.     id = tile_id
  585.  
  586.     mode = "fill"
  587.     block = "hardened_clay"
  588.     output("Setting to hardened clay.")
  589.     handler()
  590. })
  591.  
  592. player.onChat("//set-wood", function (tile_id) {
  593.     id = tile_id
  594.  
  595.     mode = "fill"
  596.     block = "planks"
  597.     output("Setting to planks.")
  598.     handler()
  599. })
  600.  
  601. player.onChat("//set-barrier", function (tile_id) {
  602.     id = tile_id
  603.  
  604.     mode = "fill"
  605.     block = "barrier"
  606.     output("Setting to barrier.")
  607.     handler()
  608. })
  609.  
  610. player.onChat("//obby", function (tile_id) {
  611.     id = tile_id
  612.  
  613.     mode = "fill"
  614.     block = "obsidian"
  615.     output("Setting to obsidian.")
  616.     handler()
  617. })
  618.  
  619. player.onChat("//set-wood6", function (tile_id) {
  620.     id = tile_id
  621.  
  622.     mode = "fill"
  623.     block = "wood"
  624.     output("Setting to 6 sided wood.")
  625.     handler()
  626. })
  627.  
  628. player.onChat("//set-bedrock", function (tile_id) {
  629.     id = tile_id
  630.  
  631.     mode = "fill"
  632.     block = "bedrock"
  633.     output("Setting to "+block+".")
  634.     handler()
  635. })
  636.  
  637. player.onChat("//set-terracotta-stained", function (tile_id) {
  638.     id = tile_id
  639.  
  640.     mode = "fill"
  641.     block = "stained_hardened_clay"
  642.     output("Setting to "+block+".")
  643.     handler()
  644. })
  645.  
  646. player.onChat("//version", function (tile_id) {
  647.     output("Version: "+version)
  648. })
  649.  
  650. player.onChat("//pos1", function () {
  651.     let pos = player.position().toString().split(" ")
  652.     pos1 = pos[0]+" "+pos[1]+" "+pos[2]
  653.     output("Set position 1 to "+pos1+".")
  654. })
  655.  
  656. player.onChat("//vanish", function () {
  657.    
  658. })
  659.  
  660. player.onChat("//mutechat", function () {
  661.     if (muted == false) {
  662.         muted = true
  663.         output("Muting chat (only works on Eduction features enabled)")
  664.         player.execute("tag @s[tag=!Admin] add Admin")
  665.         player.execute("ability @a[tag=!Admin] mute true")
  666.     } else {
  667.         muted = false
  668.         output("Un-muting chat (only works on Eduction features enabled)")
  669.         player.execute("tag @s[tag=!Admin] add Admin")
  670.         player.execute("ability @a[tag=!Admin] mute false")
  671.     }
  672. })
  673.  
  674. player.onChat("//paste", function () {
  675.     player.execute("clone "+pos1+" "+pos2+" ~ ~ ~")
  676.     output("Pasted to your position")
  677. })
  678.  
  679. player.onItemInteracted(WOODEN_AXE, function () {
  680.     if (posit == 1) {
  681.         posit = 2
  682.         let pos = player.position().toString().split(" ")
  683.         pos1 = pos[0]+" "+pos[1]+" "+pos[2]
  684.         output("Set position 1 to "+pos1+".")
  685.     } else {
  686.         posit = 1
  687.         let pos = player.position().toString().split(" ")
  688.         pos2 = pos[0]+" "+pos[1]+" "+pos[2]
  689.         output("Set position 2 to "+pos2+".")
  690.     }
  691. })
  692.  
  693. player.onChat("//sphere", function (lol) {
  694.     shapes.sphere(WOOL, pos(0,0,0), lol, ShapeOperation.Replace)
  695. })
  696.  
  697.  
  698. player.onChat("//pos2", function () {
  699.     let pos = player.position().toString().split(" ")
  700.     pos2 = pos[0]+" "+pos[1]+" "+pos[2]
  701.     output("Set position 2 to "+pos2+".")
  702. })
  703.  
  704.  
  705. player.onChat("region-pvp-deny", function () {
  706.     let x1 = pos1.split(" ")[0]
  707.     let y1 = pos1.split(" ")[1]
  708.     let z1 = pos1.split(" ")[2]
  709.  
  710.     let x2 = pos2.split(" ")[0]
  711.     let y2 = pos2.split(" ")[1]
  712.     let z2 = pos2.split(" ")[2]
  713.     output("§c Notice: this wont work. It is going to be fixed soon.. §7Command: §eeffect @a[x="+ x1 +", dx="+(parseFloat(x2) - parseFloat(x1))+", y="+y1+", dy="+(parseFloat(y2) - parseFloat(y1))+", z="+z1+", dz="+(parseFloat(z2) - parseFloat(z1))+"] strength 1 255 true")
  714. })
  715.  
  716. player.onChat("//wand", function () {
  717.  
  718.  
  719.     player.execute("give @s wooden_axe")
  720.     output("Given wand.")
  721. })
  722.  
  723. player.onChat("//center", function () {
  724.     let x1 = pos1.split(" ")[0]
  725.     let y1 = pos1.split(" ")[1]
  726.     let z1 = pos1.split(" ")[2]
  727.  
  728.     let x2 = pos2.split(" ")[0]
  729.     let y2 = pos2.split(" ")[1]
  730.     let z2 = pos2.split(" ")[2]
  731.  
  732.     let ycen = Math.floor((parseFloat(y1) + parseFloat(y2)) / 2)
  733.     let xcen = Math.floor((parseFloat(x1) + parseFloat(x2)) / 2)
  734.     let zcen = Math.floor((parseFloat(z1) + parseFloat(z2)) / 2)
  735.     player.execute("setblock "+xcen+" "+ycen+" "+zcen+" diamond_block")
  736.     let center = 1
  737.     outputAll("Found center and set to diamond. §cNOTICE: this sometimes will not get the dead center of what your region is.")
  738. })
  739.  
  740. player.onChat("//clearlag", function () {
  741.     player.execute("kill @e[type=item]")
  742.     outputAll("cleared lag")
  743. })
  744.  
  745.  
  746. player.onChat("//feed-all", function () {
  747.     outputAll("Everyone has been fed.")
  748.     run("effect @a saturation 1 255 true")
  749. })
  750.  
  751. player.onChat("//feed", function () {
  752.     output("You have been fed.")
  753.     run("effect @s saturation 1 255 true")
  754. })
  755.  
  756. outputAll("§l§cC.C. WORLDEDIT Version "+version)
  757.  
  758. output("WorldEdit Code Connection edition by Imrglop loaded. \n(This is not actual FAWE) Works best with Education Edition or EDU Features enabled\n To use a command put a SPACE between // like ' //undo' and not '//undo'")
Add Comment
Please, Sign In to add comment