iplaymincraft0489

Make a mod that as soon as someone spawns in the game it spawns an ai player and an OP can use commands to summon natural disaster make sure it works server side so the player don't need to download it.

Kodari AI
KodariToday at 6:49 pm 1
DisasterSummoner
A server-side Minecraft plugin that automatically spawns an AI-controlled player for every real player upon joining. The AI mimics basic movement and interaction. Additionally, operators can use commands to summon natural disasters such as lightning storms, earthquakes, tornadoes, floods, and meteor showers, affecting the world dynamically. All functionality runs entirely server-side, requiring no client modifications.

I’ll build this as a server-side plugin. The AI companion will be a named, AI-controlled zombie—not a true player NPC—and operators will get commands for several disasters.

Created the server-side plugin; players don’t need to download anything.

Operators can use /disaster <lightning|meteor|earthquake|tornado> [player]. Meteors and earthquakes damage terrain, and lightning can start fires.

Each joining player gets a named AI-controlled zombie, not a true player NPC.

iplaymincraft0489

Will the zombie have a skin and how will it act? Also, add a hurricane natural disaster where blocks start flying and add special effects to every natural disaster:

  • The hurricane I just told you
  • The tornado spawns an actual tornado
  • The earthquake, the screen starts shaking
  • The meteor shower, meteors start spawning and falling down
  • Lightning, well, you know, lightning
Kodari AI
KodariToday at 6:58 pm 2

The companion uses the normal zombie appearance, not a player skin. I’ll check its current behavior and add the disaster effects server-side.

  1. Add a hurricane with flying debris and a visible tornado funnel.

  2. Animate falling meteors and add earthquake screen distortion; keep real lightning strikes.

Added /disaster hurricane [player] and visual effects for all disasters. Hurricane debris is visual copies of blocks; earthquakes use screen distortion and jolts rather than true camera shake.

The companion has the normal zombie skin and default zombie behavior: it can attack players, burn in sunlight, and wander. It doesn’t currently follow or protect its owner.

iplaymincraft0489

Okay then, just remove the companion. Also, why do I have to put a player's name for the disaster? Is that to know where to spawn it?

Kodari AI
KodariToday at 6:59 pm 1
  • Remove companion spawning and its event handlers.

  • Keep disaster targeting unchanged; the player name is optional in-game.

Removed the zombie companion.

Yes—the player name tells the plugin where to spawn the disaster. It’s optional in-game: /disaster tornado targets your location, while /disaster tornado Steve targets Steve’s location. The server console must specify a player.

iplaymincraft0489

Tell me about it is it fabric and what version is it for because I need it to be fabric and for Minecraft 26.3

Kodari AI
KodariToday at 7:09 pm 1

This project is a server-side plugin, not a Fabric mod. Kodari supports Fabric mods for Minecraft 26.3.

Switch to Fabric 26.3

iplaymincraft0489

No I want a plugin for 26.3

Kodari AI
KodariToday at 7:10 pm 1

This is already a server-side plugin, so players won’t need to download it. It currently targets the Spigot 1.21.4 API; I can’t confirm that it works on Minecraft 26.3 yet.

You’ll need a 26.3 server that supports Bukkit plugins, such as a compatible Paper or Spigot release, to test it.

iplaymincraft0489

What??

Kodari AI
KodariToday at 7:10 pm 1

Sorry—that was confusing. You want a server-side plugin for Minecraft 26.3, and that’s what this project is for. Players won’t need to download it.

The server itself needs plugin software such as Paper or Spigot; a Fabric server can’t run this plugin directly. I haven’t verified its 26.3 compatibility yet.

iplaymincraft0489

Do I use /disaster or what?

Kodari AI
KodariToday at 11:13 pm 1

Yes. In-game, use:

/disaster <lightning|meteor|earthquake|tornado|hurricane> [player]

For example, /disaster hurricane targets your location. Add a player name to target theirs: /disaster hurricane Steve.

You need to be an operator to use it.

iplaymincraft0489

It didn't work

Kodari AI
KodariToday at 11:14 pm 1

What happened when you tried /disaster lightning? Please send the exact message you saw—or any error from the server console.

Also, what server software and Minecraft version are you running, and is the plugin installed in its plugins folder?

iplaymincraft0489

Nothing it didn't work also there is no plugins foldar and no error showed so I just put it in the mods foldar

Kodari AI
KodariToday at 11:15 pm 1

The plugin won’t load from a mods folder. It needs a plugin server such as Paper, which uses a plugins folder.

If your server is Fabric 26.3, you need a Fabric mod instead. Players still won’t need to download it if it’s built server-side.

Switch to Fabric 26.3

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 288
src/main/java/com/kodari/disasters/DisasterPlugin.java
package com.kodari.disasters;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public final class DisasterPlugin extends JavaPlugin {
    private final Set<UUID> debris = new HashSet<>();

    @Override
    public void onDisable() {
        for (UUID id : debris) {
            Entity entity = Bukkit.getEntity(id);
            if (entity != null) entity.remove();
        }
        debris.clear();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!sender.hasPermission("disasters.summon")) {
            sender.sendMessage(ChatColor.RED + "You don't have permission to summon disasters.");
            return true;
        }
        if (args.length < 1 || args.length > 2) {
            sender.sendMessage(ChatColor.YELLOW + "Usage: /disaster <lightning|meteor|earthquake|tornado|hurricane> [player]");
            return true;
        }
        Player target = args.length == 2 ? Bukkit.getPlayerExact(args[1])
                : sender instanceof Player ? (Player) sender : null;
        if (target == null) {
            sender.sendMessage(ChatColor.RED + "Specify an online player.");
            return true;
        }
        Location center = target.getLocation().clone();
        switch (args[0].toLowerCase(java.util.Locale.ROOT)) {
            case "lightning":
                lightning(center);
                break;
            case "meteor":
                meteor(center);
                break;
            case "earthquake":
                earthquake(center);
                break;
            case "tornado":
                tornado(center);
                break;
            case "hurricane":
                hurricane(center);
                break;
            default:
                sender.sendMessage(ChatColor.RED + "Unknown disaster. Choose lightning, meteor, earthquake, tornado, or hurricane.");
                return true;
        }
        sender.sendMessage(ChatColor.RED + "Summoned " + args[0] + " at " + target.getName() + ".");
        return true;
    }

    private void lightning(Location center) {
        new BukkitRunnable() {
            private int strikes;

            @Override
            public void run() {
                if (strikes++ >= 8) {
                    cancel();
                    return;
                }
                Location strike = randomSurface(center, 8);
                strike.getWorld().strikeLightning(strike);
            }
        }.runTaskTimer(this, 0L, 10L);
    }

    private void meteor(Location center) {
        new BukkitRunnable() {
            private int launched;

            @Override
            public void run() {
                if (launched++ >= 5) {
                    cancel();
                    return;
                }
                Location impact = randomSurface(center, 8);
                launchMeteor(impact);
            }
        }.runTaskTimer(this, 0L, 15L);
    }

    private void launchMeteor(Location impact) {
        XMaterial.matchXMaterial("MAGMA_BLOCK").map(XMaterial::parseMaterial).ifPresent(material -> {
            Location start = impact.clone().add(12, 30, 0);
            FallingBlock block = impact.getWorld().spawnFallingBlock(start, material.createBlockData());
            block.setGravity(false);
            block.setDropItem(false);
            debris.add(block.getUniqueId());
            new BukkitRunnable() {
                private int tick;

                @Override
                public void run() {
                    if (!block.isValid()) {
                        debris.remove(block.getUniqueId());
                        cancel();
                        return;
                    }
                    if (tick++ >= 30) {
                        block.remove();
                        debris.remove(block.getUniqueId());
                        impact.getWorld().createExplosion(impact, 3.0F, true, true);
                        cancel();
                        return;
                    }
                    Location position = start.clone().add(-12.0 * tick / 30.0, -30.0 * tick / 30.0, 0);
                    block.teleport(position);
                    XParticle.of("FLAME").ifPresent(p -> position.getWorld().spawnParticle(p.get(), position, 12, 0.5, 0.5, 0.5, 0.02));
                    XParticle.of("SMOKE").ifPresent(p -> position.getWorld().spawnParticle(p.get(), position, 8, 0.4, 0.4, 0.4, 0.02));
                }
            }.runTaskTimer(this, 0L, 1L);
        });
    }

    private void earthquake(Location center) {
        for (Entity entity : center.getWorld().getNearbyEntities(center, 12, 8, 12)) {
            if (entity instanceof Player) {
                XPotion.matchXPotion("NAUSEA")
                        .map(potion -> potion.buildPotionEffect(100, 0))
                        .ifPresent(((Player) entity)::addPotionEffect);
            }
        }
        new BukkitRunnable() {
            private int shocks;

            @Override
            public void run() {
                if (shocks++ >= 8) {
                    cancel();
                    return;
                }
                Location impact = randomSurface(center, 8);
                impact.getWorld().createExplosion(impact, 1.5F, false, true);
                for (Entity entity : center.getWorld().getNearbyEntities(center, 12, 8, 12)) {
                    entity.setVelocity(entity.getVelocity().add(new Vector(
                            randomOffset(0.35), 0.35, randomOffset(0.35))));
                }
            }
        }.runTaskTimer(this, 0L, 10L);
    }

    private void tornado(Location center) {
        new BukkitRunnable() {
            private int ticks;

            @Override
            public void run() {
                if (ticks++ >= 100) {
                    cancel();
                    return;
                }
                for (double height = 0; height <= 18; height += 0.6) {
                    double radius = 0.6 + height * 0.23;
                    double angle = ticks * 0.35 + height * 1.2;
                    Location point = center.clone().add(Math.cos(angle) * radius, height, Math.sin(angle) * radius);
                    XParticle.of("CLOUD").ifPresent(p -> point.getWorld().spawnParticle(p.get(), point, 4, 0.25, 0.2, 0.25, 0.01));
                }
                for (Entity entity : center.getWorld().getNearbyEntities(center, 10, 12, 10)) {
                    Vector inward = center.toVector().subtract(entity.getLocation().toVector());
                    inward.setY(0);
                    if (inward.lengthSquared() < 0.01) {
                        inward = new Vector(1, 0, 0);
                    }
                    inward.normalize();
                    Vector swirl = new Vector(-inward.getZ(), 0, inward.getX()).multiply(0.45);
                    entity.setVelocity(swirl.add(inward.multiply(0.18)).setY(0.35));
                }
            }
        }.runTaskTimer(this, 0L, 2L);
    }