Jaeliv Concepts

Make a mod whenever someone says /distort then it makes blocks apear randomly and destroy the area around you and make it random blocks and also there should be a way u can set the number of blocks you want to distort

Kodari AI
KodariNov 3 at 1:16 pm 2
AreaDistortion
AreaDistortion is a Minecraft plugin that adds a /distort command, allowing players to trigger chaotic block transformations around their location. When executed, the plugin randomly replaces blocks within a configurable radius with random block types, effectively destroying the surrounding area. Players can customize the intensity by setting the number of blocks to distort via a subcommand or configuration. The plugin handles world protection checks, respects build permissions, and provides a visual and auditory effect during the distortion. It supports both survival and creative modes, with configurable cooldowns and messages for a complete gameplay experience.
  • Add /distort [count] to replace random blocks around the player.

  • Limit each use to 10,000 blocks and require a permission.

Created /distort [count] with a default of 100 blocks and a maximum of 10,000. It requires the distort.use permission, granted to operators by default.

Warning: This permanently replaces blocks, including containers and their contents.

Jaeliv Concepts

make a mod where whenever someone says /farlands it generates a farlands terrian that is as long as a normal biome in minecraft

Kodari AI
KodariNov 3 at 1:48 pm 2
  • Add /farlands with a confirmation step, since it replaces existing terrain.

  • Generate a 128×128 area of warped cliffs and overhangs in batches.

Added /farlands to generate a 128×128 area of Far Lands-style cliffs. Use /farlands confirm to start; the farlands.use permission defaults to operators.

Warning: Generation permanently replaces existing blocks and containers. Back up your world first.

Jaeliv Concepts

make a mod where whenever someone says /farlands it generates a farlands terrian that is as long as a normal biome in minecraft but make it 1000x1000

Kodari AI
KodariNov 3 at 1:48 pm 1
  • Expand the existing generator to 1,000×1,000 blocks, centered on the player.

  • Keep confirmation and batched generation to limit server load.

/farlands confirm now generates a 1,000×1,000 area centered on you.

Back up your world first: existing terrain and containers will be replaced. Generation runs in batches and takes at least about 104 minutes at 20 TPS.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 187
src/main/java/com/kodari/distort/DistortPlugin.java
package com.kodari.distort;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.noise.SimplexNoiseGenerator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

public final class DistortPlugin extends JavaPlugin {
    private final List<Material> materials = new ArrayList<>();
    private boolean generatingFarlands;

    @Override
    public void onEnable() {
        for (String name : new String[]{"STONE", "DIRT", "COBBLESTONE", "SAND", "GRAVEL",
                "OAK_PLANKS", "GLASS", "NETHERRACK", "OBSIDIAN", "GOLD_BLOCK", "DIAMOND_BLOCK"}) {
            XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial).ifPresent(materials::add);
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("farlands")) {
            return generateFarlands(sender, args);
        }
        if (!(sender instanceof Player)) {
            sender.sendMessage(ChatColor.RED + "Only players can distort the area around them.");
            return true;
        }
        if (args.length > 1) {
            return false;
        }
        int count = 100;
        if (args.length == 1) {
            try {
                count = Integer.parseInt(args[0]);
            } catch (NumberFormatException exception) {
                sender.sendMessage(ChatColor.RED + "Enter a number from 1 to 10000.");
                return true;
            }
        }
        if (count < 1 || count > 10000) {
            sender.sendMessage(ChatColor.RED + "Enter a number from 1 to 10000.");
            return true;
        }
        if (materials.isEmpty()) {
            sender.sendMessage(ChatColor.RED + "No distortion blocks are available.");
            return true;
        }

        Player player = (Player) sender;
        Location center = player.getLocation();
        World world = player.getWorld();
        int radius = 1;
        while ((2 * radius + 1) * (2 * radius + 1) * (2 * radius + 1) < count * 2) {
            radius++;
        }
        List<Location> locations = new ArrayList<>();
        for (int x = -radius; x <= radius; x++) {
            for (int y = -radius; y <= radius; y++) {
                int blockY = center.getBlockY() + y;
                if (blockY < world.getMinHeight() || blockY >= world.getMaxHeight()) {
                    continue;
                }
                for (int z = -radius; z <= radius; z++) {
                    locations.add(new Location(world, center.getBlockX() + x, blockY, center.getBlockZ() + z));
                }
            }
        }
        Collections.shuffle(locations);
        int changed = Math.min(count, locations.size());
        ThreadLocalRandom random = ThreadLocalRandom.current();
        for (int i = 0; i < changed; i++) {
            locations.get(i).getBlock().setType(materials.get(random.nextInt(materials.size())), false);
        }
        sender.sendMessage(ChatColor.GREEN + "Distorted " + changed + " blocks around you.");
        return true;
    }

    private boolean generateFarlands(CommandSender sender, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage(ChatColor.RED + "Only players can generate Far Lands.");
            return true;
        }
        if (args.length != 1 || !args[0].equalsIgnoreCase("confirm")) {
            sender.sendMessage(ChatColor.RED + "This replaces terrain and containers in a 1000x1000 area around you. Move somewhere safe, back up your world, and use /farlands confirm to start.");
            return true;
        }
        if (generatingFarlands) {
            sender.sendMessage(ChatColor.RED + "Far Lands generation is already running.");
            return true;
        }
        Material stone = XMaterial.matchXMaterial("STONE").map(XMaterial::parseMaterial).orElse(null);
        Material air = XMaterial.matchXMaterial("AIR").map(XMaterial::parseMaterial).orElse(null);
        if (stone == null || air == null) {
            sender.sendMessage(ChatColor.RED + "The required terrain blocks are unavailable.");
            return true;
        }
        Player player = (Player) sender;
        Location center = player.getLocation();
        World world = player.getWorld();
        int size = 1000;
        int startX = center.getBlockX() - size / 2;
        int startZ = center.getBlockZ() - size / 2;
        int base = Math.max(world.getMinHeight(), Math.min(world.getMaxHeight() - 1, center.getBlockY() - 1));
        int minY = Math.max(world.getMinHeight(), base - 16);
        int maxY = Math.min(world.getMaxHeight() - 1, base + 80);
        SimplexNoiseGenerator noise = new SimplexNoiseGenerator(new Random(world.getSeed()));
        generatingFarlands = true;
        sender.sendMessage(ChatColor.YELLOW + "Generating Far Lands over 1000x1000 blocks. Existing terrain will be replaced; stay clear of the area.");
        new BukkitRunnable() {
            private int column;

            @Override
            public void run() {
                for (int n = 0; n < 8 && column < size * size; n++, column++) {
                    int x = startX + column / size;
                    int z = startZ + column % size;
                    double ridge = Math.abs(noise.noise(x * 0.018, z * 0.018));
                    double height = base + 15 + ridge * 90;
                    for (int y = minY; y <= maxY; y++) {
                        double warp = noise.noise(x * 0.035, y * 0.035, z * 0.035) * 27;
                        boolean solid = y < base - 8 || y < height + warp;
                        world.getBlockAt(x, y, z).setType(solid ? stone : air, false);
                    }
                }
                if (column >= size * size) {
                    generatingFarlands = false;
                    sender.sendMessage(ChatColor.GREEN + "Far Lands generation complete.");
                    cancel();
                }
            }
        }.runTaskTimer(this, 1L, 1L);
        return true;
    }
}