list.new("items"); list.add($items, "portal"); list.add($items, "carrots"); list.add($items, "potatoes"); list.add($items, "air"); list.add($items, "water"); list.add($items, "lava"); list.add($items, "stone"); list.add($items, "stone:1"); list.add($items, "stone:2"); list.add($items, "stone:3"); list.add($items, "stone:4"); list.add($items, "stone:5"); list.add($items, "stone:6"); list.add($items, "dirt"); list.add($items, "dirt:1"); list.add($items, "dirt:2"); list.add($items, "cobblestone"); list.add($items, "planks"); list.add($items, "planks:1"); list.add($items, "planks:2"); list.add($items, "planks:3"); list.add($items, "planks:4"); list.add($items, "planks:5"); list.add($items, "sapling"); list.add($items, "sapling:1"); list.add($items, "sapling:2"); list.add($items, "sapling:3"); list.add($items, "sapling:4"); list.add($items, "sapling:5"); list.add($items, "sand"); list.add($items, "sand:1"); list.add($items, "gravel"); list.add($items, "gold_ore"); list.add($items, "iron_ore"); list.add($items, "log"); list.add($items, "log:1"); list.add($items, "log:2"); list.add($items, "log:3"); list.add($items, "log:4"); list.add($items, "log:5"); list.add($items, "leaves"); list.add($items, "leaves:1"); list.add($items, "leaves:2"); list.add($items, "leaves:3"); list.add($items, "sponge"); list.add($items, "sponge:1"); list.add($items, "glass"); list.add($items, "lapis_block"); list.add($items, "dispenser"); list.add($items, "sandstone"); list.add($items, "sandstone:1"); list.add($items, "sandstone:2"); list.add($items, "noteblock"); list.add($items, "golden_rail"); list.add($items, "detector_rail"); list.add($items, "tallgrass:1"); list.add($items, "tallgrass:2"); list.add($items, "deadbush"); list.add($items, "piston"); list.add($items, "wool"); list.add($items, "wool:1"); list.add($items, "wool:2"); list.add($items, "wool:3"); list.add($items, "wool:4"); list.add($items, "wool:6"); list.add($items, "wool:7"); list.add($items, "wool:9"); list.add($items, "wool:10"); list.add($items, "wool:11"); list.add($items, "wool:12"); list.add($items, "wool:13"); list.add($items, "wool:14"); list.add($items, "yellow_flower"); list.add($items, "red_flower"); list.add($items, "red_flower:1"); list.add($items, "red_flower:2"); list.add($items, "red_flower:3"); list.add($items, "red_flower:4"); list.add($items, "red_flower:5"); list.add($items, "red_flower:6"); list.add($items, "red_flower:7"); list.add($items, "red_flower:8"); list.add($items, "brown_mushroom"); list.add($items, "red_mushroom"); list.add($items, "gold_block"); list.add($items, "iron_block"); list.add($items, "stone_slab"); list.add($items, "stone_slab:1"); list.add($items, "stone_slab:3"); list.add($items, "stone_slab:4"); list.add($items, "stone_slab:5"); list.add($items, "stone_slab:6"); list.add($items, "stone_slab:7"); list.add($items, "brick_block"); list.add($items, "quartz_block"); list.add($items, "quartz_block:1"); list.add($items, "mossy_cobblestone"); list.add($items, "obsidian"); list.add($items, "torch"); list.add($items, "oak_stairs"); list.add($items, "chest"); list.add($items, "diamond_block"); list.add($items, "crafting_table"); list.add($items, "furnace"); list.add($items, "ladder"); list.add($items, "rail"); list.add($items, "stone_stairs"); list.add($items, "lever"); list.add($items, "stone_pressure_plate"); list.add($items, "wooden_pressure_plate"); list.add($items, "redstone_torch"); list.add($items, "stone_button"); list.add($items, "snow_layer"); list.add($items, "snow"); list.add($items, "cactus"); list.add($items, "clay"); list.add($items, "jukebox"); list.add($items, "fence"); list.add($items, "pumpkin"); list.add($items, "lit_pumpkin"); list.add($items, "stained_glass:1"); list.add($items, "stained_glass:2"); list.add($items, "stained_glass:3"); list.add($items, "stained_glass:4"); list.add($items, "stained_glass:6"); list.add($items, "stained_glass:7"); list.add($items, "stained_glass:9"); list.add($items, "stained_glass:10"); list.add($items, "stained_glass:11"); list.add($items, "stained_glass:12"); list.add($items, "stained_glass:13"); list.add($items, "stained_glass:14"); list.add($items, "trapdoor"); list.add($items, "stonebrick"); list.add($items, "stonebrick:1"); list.add($items, "stonebrick:2"); list.add($items, "iron_bars"); list.add($items, "glass_pane"); list.add($items, "melon_block"); list.add($items, "vine"); list.add($items, "fence_gate"); list.add($items, "brick_stairs"); list.add($items, "stone_brick_stairs"); list.add($items, "waterlily"); list.add($items, "double_wooden_slab:4"); list.add($items, "double_wooden_slab:5"); list.add($items, "wooden_slab"); list.add($items, "wooden_slab:1"); list.add($items, "wooden_slab:2"); list.add($items, "wooden_slab:3"); list.add($items, "wooden_slab:4"); list.add($items, "wooden_slab:5"); list.add($items, "sandstone_stairs"); list.add($items, "tripwire_hook"); list.add($items, "emerald_block"); list.add($items, "spruce_stairs"); list.add($items, "birch_stairs"); list.add($items, "jungle_stairs"); list.add($items, "cobblestone_wall"); list.add($items, "cobblestone_wall:1"); list.add($items, "wooden_button"); list.add($items, "anvil"); list.add($items, "anvil:1"); list.add($items, "anvil:2"); list.add($items, "trapped_chest"); list.add($items, "light_weighted_pressure_plate"); list.add($items, "heavy_weighted_pressure_plate"); list.add($items, "redstone_block"); list.add($items, "hopper"); list.add($items, "activator_rail"); list.add($items, "dropper"); list.add($items, "stained_hardened_clay:1"); list.add($items, "stained_hardened_clay:2"); list.add($items, "stained_hardened_clay:3"); list.add($items, "stained_hardened_clay:4"); list.add($items, "stained_hardened_clay:6"); list.add($items, "stained_hardened_clay:7"); list.add($items, "stained_hardened_clay:9"); list.add($items, "stained_hardened_clay:10"); list.add($items, "stained_hardened_clay:11"); list.add($items, "stained_hardened_clay:12"); list.add($items, "stained_hardened_clay:13"); list.add($items, "stained_hardened_clay:14"); list.add($items, "stained_glass_pane:1"); list.add($items, "stained_glass_pane:2"); list.add($items, "stained_glass_pane:3"); list.add($items, "stained_glass_pane:4"); list.add($items, "stained_glass_pane:6"); list.add($items, "stained_glass_pane:7"); list.add($items, "stained_glass_pane:9"); list.add($items, "stained_glass_pane:10"); list.add($items, "stained_glass_pane:11"); list.add($items, "stained_glass_pane:12"); list.add($items, "stained_glass_pane:13"); list.add($items, "stained_glass_pane:14"); list.add($items, "leaves2"); list.add($items, "leaves2:1"); list.add($items, "log2"); list.add($items, "log2:1"); list.add($items, "acacia_stairs"); list.add($items, "dark_oak_stairs"); list.add($items, "iron_trapdoor"); list.add($items, "carpet"); list.add($items, "carpet:1"); list.add($items, "carpet:2"); list.add($items, "carpet:3"); list.add($items, "carpet:4"); list.add($items, "carpet:6"); list.add($items, "carpet:7"); list.add($items, "carpet:9"); list.add($items, "carpet:10"); list.add($items, "carpet:11"); list.add($items, "carpet:12"); list.add($items, "carpet:13"); list.add($items, "carpet:14"); list.add($items, "hardened_clay"); list.add($items, "coal_block"); list.add($items, "packed_ice"); list.add($items, "double_plant"); list.add($items, "double_plant:1"); list.add($items, "double_plant:2"); list.add($items, "double_plant:3"); list.add($items, "double_plant:4"); list.add($items, "double_plant:5"); list.add($items, "end_stone"); list.add($items, "red_sandstone"); list.add($items, "red_sandstone:1"); list.add($items, "red_sandstone:2"); list.add($items, "red_sandstone_stairs"); list.add($items, "stone_slab2"); list.add($items, "spruce_fence_gate"); list.add($items, "birch_fence_gate"); list.add($items, "jungle_fence_gate"); list.add($items, "dark_oak_fence_gate"); list.add($items, "acacia_fence_gate"); list.add($items, "spruce_fence"); list.add($items, "birch_fence"); list.add($items, "jungle_fence"); list.add($items, "dark_oak_fence"); list.add($items, "acacia_fence"); list.add($items, "grass_path"); list.add($items, "coal_ore"); list.add($items, "diamond_ore"); list.add($items, "iron_ore"); list.add($items, "gold_ore"); list.add($items, "string"); list.add($items, "wheat"); list.add($items, "painting"); list.add($items, "wall_sign"); list.add($items, "standing_sign"); list.add($items, "wooden_door"); list.add($items, "iron_door"); list.add($items, "redstone_ore"); list.add($items, "reeds"); list.add($items, "bed"); list.add($items, "repeater"); list.add($items, "cauldron"); list.add($items, "emerald_ore"); list.add($items, "flower_pot"); list.add($items, "banner:1"); list.add($items, "banner:2"); list.add($items, "banner:3"); list.add($items, "banner:4"); list.add($items, "banner:6"); list.add($items, "banner:7"); list.add($items, "banner:9"); list.add($items, "banner:10"); list.add($items, "banner:11"); list.add($items, "banner:12"); list.add($items, "banner:13"); list.add($items, "banner:14"); list.add($items, "spruce_door"); list.add($items, "birch_door"); list.add($items, "jungle_door"); list.add($items, "acacia_door"); list.add($items, "dark_oak_door"); list.add($items, "beetroot"); list.add($items, "beetroot_seeds"); list.add($items, "beetroot_soup"); list.add($items, "shield"); list.new("undotype"); list.new("undodata"); list.new("undoloc"); no_join = true; event.load("custom_command"); event.load("block_click"); event.load("block_break"); event.load("player_leave"); event.load("player_giveup"); command.add("set"); command.add("pos1"); command.add("pos2"); command.add("undo"); command.add("replace"); command.add("copy"); command.add("paste"); if(player == null) { term(); } player.speak(player, "§dWorldedit", "§rDu hast nun Worldedit"); @wait wait(); if(event == "player_leave" || event == "player_giveup") { term(); } if(event == "custom_command") { if(command == "pos1") { temploc = entity.getLocation(player); goto("setloc1"); } if(command == "pos2") { temploc = entity.getLocation(player); goto("setloc2"); } if(wepos1 == null || wepos2 == null) { player.speak(player, "§dWorldedit", "§rWähle zuerst einen Bereich aus!"); goto("wait"); } if(command == "undo") { p = player; i = -1; while(inc("i") < list.getSize(undotype)) { block.set(list.getIndex(undoloc, i), read.item(concat(list.getIndex(undotype, i), ":", text.number(list.getIndex(undodata, i))))); reset(); } player.speak(p, "§dWorldedit", "§rÄnderungen rückgängig gemacht"); goto("wait"); } if(command == "copy") { world1 = loc.getCoord(wepos1, "w"); world2 = loc.getCoord(wepos2, "w"); if(world1 != world2) { player.speak(player, "§dWorldedit", "§rDie Welten der Koordinaten stimmen nicht überein!"); goto("wait"); } gosub("correctcoords"); copystartloc1 = read.location(concat(world1, ":", x1, ":", y1, ":", z1)); xcopyedgedistance = x2 - x1; ycopyedgedistance = y2 - y1; zcopyedgedistance = z2 - z1; playertoedgex = x1 - loc.getCoord(entity.getLocation(player), "bx"); playertoedgey = y1 - loc.getCoord(entity.getLocation(player), "by"); playertoedgez = z1 - loc.getCoord(entity.getLocation(player), "bz"); player.speak(player, "§dWorldedit", "§rBereit zum Kopieren"); goto("wait"); } if(command == "paste") { p = player; counter = 0; list.clear(undotype); list.clear(undodata); list.clear(undoloc); pastestartloc1 = loc.mod(entity.getLocation(player), playertoedgex, playertoedgey, playertoedgez); x = 0; @startpaste_x y = 0; @startpaste_y z = 0; @startpaste_z relloc1 = loc.mod(copystartloc1, x, y, z); relloc2 = loc.mod(pastestartloc1, x, y, z); list.add(undotype, block.getType(relloc2)); list.add(undodata, block.getData(relloc2)); list.add(undoloc, relloc2); block.clone(relloc1, relloc2); if(inc("counter") == 1500) { gosub("waitfor"); } reset(); if(inc("z") <= zcopyedgedistance) { goto("startpaste_z"); } if(inc("y") <= ycopyedgedistance) { goto("startpaste_y"); } if(inc("x") <= xcopyedgedistance) { goto("startpaste_x"); } player.speak(p, "§dWorldedit", "§rBlöcke kopiert"); goto("wait"); } if(command == "replace") { p = player; if(list.getSize(args) != 2) { player.speak(player, "§dWorldedit", "§r/replace "); goto("wait"); } if(invert(list.contains(items, toLowerCase(list.getIndex(args, 0)))) || invert(list.contains(items, toLowerCase(list.getIndex(args, 1))))) { player.speak(player, "§dWorldedit", "§rUngültiger Block"); goto("wait"); } item1 = read.item(toLowerCase(list.getIndex(args, 0))); item2 = read.item(toLowerCase(list.getIndex(args, 1))); world1 = loc.getCoord(wepos1, "w"); world2 = loc.getCoord(wepos2, "w"); if(world1 != world2) { player.speak(player, "§dWorldedit", "§rDie Welten der Koordinaten stimmen nicht überein!"); goto("wait"); } list.clear(undotype); list.clear(undodata); list.clear(undoloc); gosub("correctcoords"); counter = 0; counter2 = 0; startloc1 = read.location(concat(world1, ":", x1, ":", y1, ":", z1)); startloc2 = read.location(concat(world2, ":", x2, ":", y2, ":", z2)); xedgedistance = x2 - x1; yedgedistance = y2 - y1; zedgedistance = z2 - z1; x = 0; @startreplace_x y = 0; @startreplace_y z = 0; @startreplace_z relloc = loc.mod(startloc1, x, y, z); if(block.getType(relloc) == item.getType(item1) && block.getData(relloc) == item.getData(item1)) { list.add(undotype, block.getType(relloc)); list.add(undodata, block.getData(relloc)); list.add(undoloc, relloc); block.set(relloc, item2); inc("counter2"); } if(inc("counter") == 1500) { gosub("waitfor"); } reset(); if(inc("z") <= zedgedistance) { goto("startreplace_z"); } if(inc("y") <= yedgedistance) { goto("startreplace_y"); } if(inc("x") <= xedgedistance) { goto("startreplace_x"); } player.speak(p, "§dWorldedit", "§r", counter2, " Blöcke ersetzt"); goto("wait"); } if(command == "set") { p = player; if(list.getSize(args) != 1) { player.speak(player, "§dWorldedit", "§r/set "); goto("wait"); } if(list.contains(items, toLowerCase(list.getIndex(args, 0)))) { item = read.item(toLowerCase(list.getIndex(args, 0))); world1 = loc.getCoord(wepos1, "w"); world2 = loc.getCoord(wepos2, "w"); if(world1 != world2) { player.speak(player, "§dWorldedit", "§rDie Welten der Koordinaten stimmen nicht überein!"); goto("wait"); } list.clear(undotype); list.clear(undodata); list.clear(undoloc); gosub("correctcoords"); counter = 0; startloc1 = read.location(concat(world1, ":", x1, ":", y1, ":", z1)); startloc2 = read.location(concat(world2, ":", x2, ":", y2, ":", z2)); xedgedistance = x2 - x1; yedgedistance = y2 - y1; zedgedistance = z2 - z1; x = 0; @startset_x y = 0; @startset_y z = 0; @startset_z relloc = loc.mod(startloc1, x, y, z); list.add(undotype, block.getType(relloc)); list.add(undodata, block.getData(relloc)); list.add(undoloc, relloc); block.set(relloc, item); if(inc("counter") == 1500) { gosub("waitfor"); } reset(); if(inc("z") <= zedgedistance) { goto("startset_z"); } if(inc("y") <= yedgedistance) { goto("startset_y"); } if(inc("x") <= xedgedistance) { goto("startset_x"); } player.speak(p, "§dWorldedit", "§rBlöcke gesetzt"); goto("wait"); } else { player.speak(player, "§dWorldedit", "§rUnkorrekter Block-Type"); goto("wait"); } } } player_item_type = item.getType(entity.getEquip(player, "hand")); if(player_item_type != "minecraft:golden_axe") { goto("wait"); } if(event == "block_break") { cancel = true; goto("wait"); } if(event == "block_click") { if(action == "left") { temploc = block_loc; goto("setloc1"); } if(action == "right") { temploc = block_loc; goto("setloc2"); } } goto("wait"); @setloc1 wepos1 = temploc; player.speak(player, "§dWorldedit", "§dPos1: §r", text.location(temploc)); removeVar("temploc"); goto("wait"); @setloc2 wepos2 = temploc; player.speak(player, "§dWorldedit", "§dPos2: §r", temploc); removeVar("temploc"); goto("wait"); @waitfor waitfor(1); return(); @correctcoords x1 = loc.getCoord(wepos1, "bx"); y1 = loc.getCoord(wepos1, "by"); z1 = loc.getCoord(wepos1, "bz"); x2 = loc.getCoord(wepos2, "bx"); y2 = loc.getCoord(wepos2, "by"); z2 = loc.getCoord(wepos2, "bz"); if(x1 > x2) { helper = x2; x2 = x1; x1 = helper; } if(y1 > y2) { helper = y2; y2 = y1; y1 = helper; } if(z1 > z2) { helper = z2; z2 = z1; z1 = helper; } removeVar("helper"); return();