Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // win10 code connection worldedit? Currently it is somewhat buggy. Bedrock edition.
- // version 1.1 check back for updates
- // 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
- // turn on Education Features for full experience
- // VERSION 1.1 NEW UPDATE MORE BLOCKS ADDED (MAYBE) AND /RG EXPAND ADDED
- // win10 code connection worldedit? Currently it is somewhat buggy. Bedrock edition.
- // version 1.0 check back for updates
- // 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
- // turn on Education Features for full experience
- let pos1 = "0 1 0"
- let pos2 = "0 1 0"
- let block = "stone"
- let id = 0
- let mode = "fill"
- let muted = false
- let posit = 1
- let replacemode = false
- let version = "1.1"
- let brush = "stone"
- let brushid = 0
- // by Imrglop
- // not actual worldedit
- player.execute('/tag @s add Admin')
- function output(text: string) {
- player.execute('tellraw @s {"rawtext":[{"text":"§8§l(§4FAWE§8)§r§7 '+text+'"}]}')
- }
- function run(text: string) {
- player.execute(text)
- }
- player.onChat("//help", function(){
- output("Commands:")
- output(" Blocks:")
- output(" //set-(block) (tile id)\n//sphere (rad)\n//feed\n//feed-all\n//clearlag\n//bringAgnet\n//replacemode")
- })
- player.onChat("//bringAgent", function () {
- agent.teleportToPlayer()
- })
- player.onChat("//speed", function (speednum) {
- output("Speed updated to "+speednum)
- run(`effect @s speed 10000 ${speednum} true`)
- })
- player.onChat("//smite", function () {
- outputAll("Thou hast been smitten!")
- player.execute("execute @a ~ ~ ~ summon lightning_bolt")
- })
- function outputAll(text: string) {
- player.execute('tellraw @a {"rawtext":[{"text":"§8§l(§4FAWE§8)§r§7 '+text+'"}]}')
- }
- function handler () {
- if (mode == "fill") {
- if (replacemode == false) {
- player.execute(
- `fill ${pos1} ${pos2} ${block} ${id}`
- )
- }
- if (replacemode == true) {
- player.execute(
- `fill ${pos1} ${pos2} ${block} ${id} replace air`
- )
- }
- }
- if (mode == "fill-force") {
- run(`fill ${pos1} ${pos2} ${block} ${id}`)
- }
- if (mode == "fill-replace") {
- player.execute(
- `fill ${pos1} ${pos2} ${block} ${id} replace air`
- )
- }
- }
- // BOOKMARK DOG CAT TREE TRAIN FAST
- player.onChat("//add", function(item, item2) {
- outputAll(`Result: ${item+item2}`)
- })
- player.onChat("//rg-expand", function() {
- pos1 = `${pos1.split(" ")[0]} 255 ${pos1.split(" ")[2]}`
- pos2 = `${pos2.split(" ")[0]} 0 ${pos2.split(" ")[2]}`
- output("The region has been expanded. (to Y level 255 and 0)")
- })
- player.onChat("//region-expand", function() {
- pos1 = `${pos1.split(" ")[0]} 255 ${pos1.split(" ")[2]}`
- pos2 = `${pos2.split(" ")[0]} 0 ${pos2.split(" ")[2]}`
- output("The region has been expanded. (to Y level 255 and 0)")
- })
- player.onChat("//multiply", function(item, item2) {
- outputAll(`Result: ${item*item2}`)
- })
- player.onChat("//divide", function(item, item2) {
- outputAll(`Result: ${item/item2}`)
- })
- player.onChat("//subtract", function(item, item2) {
- outputAll(`Result: ${item-item2}`)
- })
- player.onChat("//set-netherbrick", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "nether_bricks"
- output(`Setting to ${block} (Tile ID:${tile_id})`)
- handler()
- })
- player.onChat("//set-gold", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "gold_block"
- output(`Setting to ${block} (Tile ID:${tile_id})`)
- handler()
- })
- player.onChat("//set-iron", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "iron_block"
- output(`Setting to ${block} (Tile ID:${tile_id})`)
- handler()
- })
- player.onChat("//set-emerald", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "emerald_block"
- output(`Setting to ${block} (Tile ID:${tile_id})`)
- handler()
- })
- player.onChat("//set-lapis", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "lapis_block"
- output(`Setting to ${block} (Tile ID:${tile_id})`)
- handler()
- })
- ///
- player.onChat("//cut", function() {
- output("Cutting!")
- id = 0
- mode = "fill-force"
- block = "air"
- output("Setting to air.")
- handler()
- })
- player.onChat("//tpall", function() {
- outputAll("TP ALL!")
- player.execute("tp @a @s")
- })
- player.onChat("//checkgamemode", function() {
- player.execute("say creative mode: @a[m=c]")
- player.execute("say survival mode: @a[m=s]")
- player.execute("say adventure mode: @a[m=a]")
- })
- player.onChat("//undo", function() {
- if (mode == "fill-replace" || replacemode == true) {
- output("Undo-ing REPLACE only.")
- run(`fill ${pos1} ${pos2} air 0 replace ${block} ${id}`)
- } else {
- 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.")
- }
- })
- player.onChat("//up", function (num) {
- player.execute("tp ~ ~"+(num+1)+" ~")
- player.execute("setblock ~ ~-1 ~ glass")
- output("Going up "+num)
- })
- player.onChat("/f", function() {
- outputAll("Press f to pay respects")
- player.execute("execute @a ~ ~ ~ say f")
- })
- player.onChat("//replacemode", function() {
- if (replacemode == false) {
- output("Enabling Replace Mode.")
- replacemode = true
- } else {
- output("Disabling Replace Mode.")
- replacemode = false
- }
- })
- player.onChat("//drain", function(dr) {
- if (dr == 0) {dr = 10}
- output("Draining " +dr)
- player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace water`)
- player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace flowing_water`)
- player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace lava`)
- player.execute(`fill ~${dr} ~${dr} ~${dr} ~-${dr} ~-${dr} ~-${dr} air 0 replace flowing_lava`)
- })
- player.onChat("//set-cobble", function () {
- id = 0
- mode = "fill"
- block = "Cobblestone"
- output("Setting to Cobblestone.")
- handler()
- })
- player.onChat("//set-quartz", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "quartz_block"
- output("Setting to quartz.")
- handler()
- })
- player.onChat("//set-smoothstone", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "smooth_stone"
- output("Setting to Smooth Stone.")
- handler()
- })
- player.onChat("//set-glass", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "glass"
- output("Setting to glass.")
- handler()
- })
- player.onChat("//set-stainedglass", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "stained_glass"
- output("Setting to stained glass.")
- handler()
- })
- player.onChat("//set-stonebrick", function () {
- id = 0
- mode = "fill"
- block = "stonebrick"
- output("Setting to Stone Bricks.")
- handler()
- })
- player.onChat("//set-stone", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "stone"
- output("Setting to Stone.")
- handler()
- })
- // decorative block
- player.onChat("//set-bed", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "bed"
- output(`Setting to ${block}.`)
- handler()
- })
- player.onChat("//brush", function () {
- player.execute("give @p stone_shovel 1 0")
- output("Given brush.")
- })
- player.onChat("//brush-stone", function (tile_id) {
- brush = "stone"
- brushid = tile_id
- output(`Set brush to stone (Tile ID: ${tile_id}).`)
- })
- player.onItemInteracted(STONE_SHOVEL, function () {
- mode = "fill-replace"
- block = brush
- if (brush == "air") {
- player.execute(`fill ^3 ^ ^10 ^-3 ^6 ^10 ${brush} ${brushid}`)
- }
- player.execute(`fill ^3 ^ ^10 ^-3 ^6 ^10 ${brush} ${brushid} replace air`)
- player.execute(`fill ^3 ^ ^10 ^-3 ^6 ^10 ${brush} ${brushid} replace water`)
- })
- player.onChat("//brush-dirt", function (tile_id) {
- brush = "stone"
- brushid = tile_id
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//brush-grass", function (tile_id) {
- brush = "grass"
- brushid = tile_id
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//brush-gravel", function (tile_id) {
- brush = "gravel"
- brushid = tile_id
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//brush-sand", function (tile_id) {
- brush = "sand"
- brushid = tile_id
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//brush-air", function (tile_id) {
- brush = "air"
- brushid = tile_id
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//brush-sand", function (tile_id) {
- brush = "sand"
- brushid = 0
- output(`Set brush to ${brush} (ID: ${tile_id}).`)
- })
- player.onChat("//set-pistonarmcollision", function () {
- id = 0
- mode = "fill"
- block = "pistonarmcollision"
- output("Setting to Piston Arm Collision.")
- handler()
- })
- player.onChat("//set-stickypistonarmcollision", function () {
- id = 0
- mode = "fill"
- block = "stickypistonarmcollision"
- output("Setting to Sticky Piston Arm Collision.")
- handler()
- })
- player.onChat("//set-farm", function (idt) {
- id = idt
- mode = "fill"
- block = "Farmland"
- output("Setting to Farmland.")
- handler()
- })
- player.onChat("//tickingarea", function (idt) {
- player.execute("tickingarea add "+pos1+" 0 "+pos2+" 0 "+" WorldEdit_TickArea +Math.randomRange(10000, 99999)")
- output("Ticking area.")
- })
- player.onChat("//clearchat", function (idt) {
- 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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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- outputAll("Chat cleared.")
- })
- player.onChat("//warn", function () {
- player.execute('tellraw @p[rm=3] {"rawtext":[{"text":"§eYou have been warned. Please do not break the rules again."}]}')
- player.execute("execute @p[rm=3] ~ ~ ~ summon lightning_bolt")
- player.execute('say §e @p[rm=3]§6 was warned.')
- })
- player.onChat("//plant-wheat", function (idt) {
- id = 7
- mode = "fill"
- block = "wheat"
- output("Plant wheat.")
- handler()
- })
- player.onChat("//light", function (idt) {
- id = idt
- mode = "fill-replace"
- block = "light_block"
- output("Light.")
- handler()
- })
- player.onChat("//set-water", function () {
- id = 0
- mode = "fill"
- block = "Water"
- output("Setting to water.")
- handler()
- })
- player.onChat("//set-lava", function () {
- id = 0
- mode = "fill"
- block = "lava"
- output("Setting to water.")
- handler()
- })
- player.onChat("/pvp-allow", function () {
- player.execute("gamerule pvp true")
- outputAll("Global Flag PVP has been set to ALLOW")
- })
- player.onChat("/pvp-deny", function () {
- player.execute("gamerule pvp false")
- outputAll("Global Flag PVP has been set to DENY")
- })
- player.onChat("/build-deny", function () {
- player.execute("immutableworld true")
- outputAll("Global Flag build has been set to DENY")
- run("ability @a[tag=Admin] worldbuilder true")
- })
- player.onChat("/build-allow", function () {
- player.execute("immutableworld false")
- outputAll("Global Flag build has been set to ALLOW")
- })
- player.onChat("//stash", function () {
- id = 0
- mode = "fill"
- block = "chest"
- output("Stash formed.")
- handler()
- })
- player.onChat("//stash-hopper", function () {
- id = 4
- mode = "fill"
- block = "hopper"
- output("Stash formed.")
- handler()
- })
- player.onChat("//set-treewood", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "log"
- output("Setting to log.")
- handler()
- })
- player.onChat("//set-concrete", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "concrete"
- output("Setting to Concrete.")
- handler()
- })
- player.onChat("//set-wool", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "wool"
- output("Setting to Wool.")
- handler()
- })
- player.onChat("//set-bricks", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "brick_block"
- output("Setting to bricks.")
- handler()
- })
- player.onChat("//kit-pvp", function() {
- run("replaceitem entity @s slot.armor.head 0 iron_helmet")
- run("replaceitem entity @s slot.armor.chest 0 iron_chestplate")
- run("replaceitem entity @s slot.armor.legs 0 iron_leggings")
- run("replaceitem entity @s slot.armor.feet 0 iron_boots")
- run("give @s iron_sword 1")
- run("give @s golden_apple 8")
- run("give @s bow 1")
- run("give @s arrow 16")
- })
- player.onChat("//set-diamond", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "Diamond_Block"
- output("Setting to diamond.")
- handler()
- })
- player.onChat("//barrierify", function (tile_id) {
- id = tile_id
- mode = "fill-replace"
- block = "barrier"
- output("Replacing air to barrier.")
- handler()
- })
- player.onChat("//set-dirt", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "dirt"
- output("Setting to Dirt.")
- handler()
- })
- player.onChat("//set-gravel", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "gravel"
- output("Setting to Gravel.")
- handler()
- })
- player.onChat("gm/c", function () {
- output("Setting gamemode to creative")
- player.execute("gamemode 1")
- })
- player.onChat("gm/s", function () {
- output("Setting gamemode to survival")
- player.execute("gamemode 0")
- })
- player.onChat("//set-air", function () {
- id = 0
- mode = "fill-force"
- block = "air"
- output("Setting to air.")
- handler()
- })
- player.onChat("//set-terracotta", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "hardened_clay"
- output("Setting to hardened clay.")
- handler()
- })
- player.onChat("//set-wood", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "planks"
- output("Setting to planks.")
- handler()
- })
- player.onChat("//set-barrier", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "barrier"
- output("Setting to barrier.")
- handler()
- })
- player.onChat("//obby", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "obsidian"
- output("Setting to obsidian.")
- handler()
- })
- player.onChat("//set-wood6", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "wood"
- output("Setting to 6 sided wood.")
- handler()
- })
- player.onChat("//set-bedrock", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "bedrock"
- output("Setting to "+block+".")
- handler()
- })
- player.onChat("//set-terracotta-stained", function (tile_id) {
- id = tile_id
- mode = "fill"
- block = "stained_hardened_clay"
- output("Setting to "+block+".")
- handler()
- })
- player.onChat("//version", function (tile_id) {
- output("Version: "+version)
- })
- player.onChat("//pos1", function () {
- let pos = player.position().toString().split(" ")
- pos1 = pos[0]+" "+pos[1]+" "+pos[2]
- output("Set position 1 to "+pos1+".")
- })
- player.onChat("//vanish", function () {
- })
- player.onChat("//mutechat", function () {
- if (muted == false) {
- muted = true
- output("Muting chat (only works on Eduction features enabled)")
- player.execute("tag @s[tag=!Admin] add Admin")
- player.execute("ability @a[tag=!Admin] mute true")
- } else {
- muted = false
- output("Un-muting chat (only works on Eduction features enabled)")
- player.execute("tag @s[tag=!Admin] add Admin")
- player.execute("ability @a[tag=!Admin] mute false")
- }
- })
- player.onChat("//paste", function () {
- player.execute("clone "+pos1+" "+pos2+" ~ ~ ~")
- output("Pasted to your position")
- })
- player.onItemInteracted(WOODEN_AXE, function () {
- if (posit == 1) {
- posit = 2
- let pos = player.position().toString().split(" ")
- pos1 = pos[0]+" "+pos[1]+" "+pos[2]
- output("Set position 1 to "+pos1+".")
- } else {
- posit = 1
- let pos = player.position().toString().split(" ")
- pos2 = pos[0]+" "+pos[1]+" "+pos[2]
- output("Set position 2 to "+pos2+".")
- }
- })
- player.onChat("//sphere", function (lol) {
- shapes.sphere(WOOL, pos(0,0,0), lol, ShapeOperation.Replace)
- })
- player.onChat("//pos2", function () {
- let pos = player.position().toString().split(" ")
- pos2 = pos[0]+" "+pos[1]+" "+pos[2]
- output("Set position 2 to "+pos2+".")
- })
- player.onChat("region-pvp-deny", function () {
- let x1 = pos1.split(" ")[0]
- let y1 = pos1.split(" ")[1]
- let z1 = pos1.split(" ")[2]
- let x2 = pos2.split(" ")[0]
- let y2 = pos2.split(" ")[1]
- let z2 = pos2.split(" ")[2]
- 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")
- })
- player.onChat("//wand", function () {
- player.execute("give @s wooden_axe")
- output("Given wand.")
- })
- player.onChat("//center", function () {
- let x1 = pos1.split(" ")[0]
- let y1 = pos1.split(" ")[1]
- let z1 = pos1.split(" ")[2]
- let x2 = pos2.split(" ")[0]
- let y2 = pos2.split(" ")[1]
- let z2 = pos2.split(" ")[2]
- let ycen = Math.floor((parseFloat(y1) + parseFloat(y2)) / 2)
- let xcen = Math.floor((parseFloat(x1) + parseFloat(x2)) / 2)
- let zcen = Math.floor((parseFloat(z1) + parseFloat(z2)) / 2)
- player.execute("setblock "+xcen+" "+ycen+" "+zcen+" diamond_block")
- let center = 1
- outputAll("Found center and set to diamond. §cNOTICE: this sometimes will not get the dead center of what your region is.")
- })
- player.onChat("//clearlag", function () {
- player.execute("kill @e[type=item]")
- outputAll("cleared lag")
- })
- player.onChat("//feed-all", function () {
- outputAll("Everyone has been fed.")
- run("effect @a saturation 1 255 true")
- })
- player.onChat("//feed", function () {
- output("You have been fed.")
- run("effect @s saturation 1 255 true")
- })
- outputAll("§l§cC.C. WORLDEDIT Version "+version)
- 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