ANAS
📎 1 file 4,215 chars
📄
pasted-code-1792246796394.txt
txt 77 lines
▶
Orbital Arsenal V1
Minecraft Mod — Version 1
1. Core Concept
Orbital Arsenal V1 is a Minecraft mod centred around powerful orbital strike cannons. The player can select different orbital attack modes, aim at a target location, and unleash devastating attacks from above.
The mod should feature multiple orbital types, each with its own payload, strike pattern, and destruction behaviour.
2. Orbital Strike Types
A. Orbital Nuke Shot
Deploys a massive array of TNT from above.
TNT is arranged in concentric rings.
Each successive ring increases in radius, creating an expanding circular formation.
TNT descends in layers, with each layer forming part of the overall strike.
Produces a massive explosion and extensive terrain destruction.
B. Orbital Stab Shot
A precision orbital strike targeting a narrow column.
Creates a direct path from the target location down to bedrock.
Designed to penetrate vertically through the terrain.
Focuses destruction on the target column rather than a large circular area.
C. Orbital Super Stab
Combines the massive scale of the Orbital Nuke Shot with the depth of the Orbital Stab Shot.
Uses expanding concentric rings of TNT, with each successive ring increasing in radius.
Unlike the regular Nuke Shot, the attack continues downward through successive layers until it reaches bedrock.
Creates a huge, deep, expanding crater rather than destroying only a limited set of layers.
D. Mob Orbitals
Calls down rings of hostile mobs from above the target location.
Mobs arrive in organised circular formations.
Supports different mob payloads, including:


Wardens
Withers
Ender Dragons
Other powerful bosses
Other configurable Minecraft mobs
Allows different mob types to be selected for different strikes.
Mob counts and ring sizes should be configurable.
E. Orbital Dripstone Cannon
Uses the same expanding-ring and descending-layer formation as the Orbital Nuke Shot.
Replaces TNT with pointed dripstone.
Drops large quantities of dripstone onto the target area.
Designed to create a devastating falling-projectile attack.
F. Orbital Arrow Cannon
Uses the same expanding-ring and descending-layer formation as the Dripstone Cannon.
Replaces dripstone with arrows.
Arrows should deal enough damage to one-shot ordinary targets and, where technically possible, powerful mobs.
Uses a dense, coordinated arrow barrage across the target area.
G. Orbital Cart Cannon
Uses the same expanding-ring and descending-layer formation as the Orbital Nuke Shot.
Replaces TNT blocks with primed TNT minecarts.
Minecarts descend in successive layers toward the target.
Explosions should create an exceptionally destructive orbital bombardment.
3. Shared Orbital Mechanics
Every orbital type should be selectable as a separate mode.
Strikes should target a chosen location.
Ring formations should expand outward with increasing radius.
Payloads should descend in coordinated layers from above.
Precision strikes and area strikes should have visibly different attack patterns.
The payload and attack logic must match the selected orbital mode.
Strike sizes, heights, ring spacing, layer spacing, and payload quantities should be configurable where practical.
4. Technical Requirements
Implement the mod for the specified Minecraft version and mod loader.
Use the appropriate Minecraft APIs for spawning entities, handling projectiles, and creating explosions.
Handle world-height limits and bedrock interactions correctly.
Avoid crashing the game when spawning large numbers of entities or explosives.
Where possible, provide configuration options for strike intensity and payload counts.
Keep the orbital systems modular so additional strike types can be added in future versions.
5. Version 1 Scope
Orbital Arsenal V1 must include exactly these seven orbital modes:
Orbital Nuke Shot
Orbital Stab Shot
Orbital Super Stab
Mob Orbitals
Orbital Dripstone Cannon
Orbital Arrow Cannon
Orbital Cart Cannon
Design objective: Create a versatile orbital arsenal featuring precision strikes, massive TNT bombardments, deep-earth destruction, boss deployment, falling dripstone, lethal arrow barrages, and TNT minecart bombardments.

Kodari AI
KodariOct 17 at 2:25 pm 3
OrbitalArsenal
Orbital Arsenal is a Minecraft mod that adds seven devastating orbital strike cannons. Players select a strike mode, aim at a target location, and unleash coordinated attacks from above. Modes include the Orbital Nuke Shot with expanding concentric TNT rings, the precision Orbital Stab Shot that penetrates to bedrock, the deep-diving Orbital Super Stab, Mob Orbitals that deploy rings of hostile bosses like Wardens and Withers, the Orbital Dripstone Cannon dropping pointed dripstone, the lethal Orbital Arrow Cannon barrage, and the Orbital Cart Cannon with primed TNT minecarts. Each strike uses expanding ring formations and descending payload layers, with configurable sizes, heights, and intensities for modular future expansion.
  • Implement the seven orbital modes as a server command targeting explicit block coordinates, with mob type selectable for mob strikes.

  • Queue strikes in paced layers to limit per-tick spawning, keep bedrock intact, and cap strike dimensions.

  • Create the Fabric 26.3 project files and survival-facing command/documentation details.

Created the Fabric 26.3 Orbital Arsenal project with all seven command-driven modes. Strikes target explicit block coordinates, spawn in paced batches, and the precision modes stop above the world’s minimum height; explosions do not break bedrock.

A player with moderator command permission can use:

  • /orbital nuke <x> <y> <z>

  • /orbital stab <x> <y> <z>

  • /orbital super_stab <x> <y> <z>

  • /orbital mob <entity_type> <x> <y> <z> — for example, minecraft:wither

  • /orbital dripstone <x> <y> <z>

  • /orbital arrow <x> <y> <z>

  • /orbital cart <x> <y> <z>

There are no new items to craft or find; the modes are accessed through these commands.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 280
src/main/java/com/kodari/orbitalarsenal/OrbitalArsenal.java
package com.kodari.orbitalarsenal;

import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.Identifier;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.permissions.Permissions;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.item.FallingBlockEntity;
import net.minecraft.world.entity.item.PrimedTnt;
import net.minecraft.world.entity.projectile.arrow.Arrow;
import net.minecraft.world.entity.vehicle.minecart.MinecartTNT;
import net.minecraft.world.level.block.Blocks;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;

public final class OrbitalArsenal implements ModInitializer {
    private static final int MAX_PENDING_PAYLOADS = 4096;
    private static final int PAYLOADS_PER_TICK = 32;
    private static final int[] RING_RADII = {0, 4, 8};
    private static final ArrayDeque<Payload> PENDING = new ArrayDeque<>();

    @Override
    public void onInitialize() {
        CommandRegistrationCallback.EVENT.register((dispatcher, buildContext, selection) -> dispatcher.register(
                Commands.literal("orbital")
                        .requires(source -> source.permissions().hasPermission(Permissions.COMMANDS_MODERATOR))
                        .then(positionCommand("nuke", Mode.NUKE))
                        .then(positionCommand("stab", Mode.STAB))
                        .then(positionCommand("super_stab", Mode.SUPER_STAB))
                        .then(mobCommand())
                        .then(positionCommand("dripstone", Mode.DRIPSTONE))
                        .then(positionCommand("arrow", Mode.ARROW))
                        .then(positionCommand("cart", Mode.CART))
        ));
        ServerTickEvents.END_SERVER_TICK.register(server -> processPending());
    }

    private static LiteralArgumentBuilder<CommandSourceStack> positionCommand(String name, Mode mode) {
        return Commands.literal(name)
                .then(Commands.argument("x", IntegerArgumentType.integer())
                        .then(Commands.argument("y", IntegerArgumentType.integer())
                                .then(Commands.argument("z", IntegerArgumentType.integer())
                                        .executes(context -> queueStrike(context, mode, null)))));
    }

    private static LiteralArgumentBuilder<CommandSourceStack> mobCommand() {
        return Commands.literal("mob")
                .then(Commands.argument("entity_type", StringArgumentType.word())
                        .then(Commands.argument("x", IntegerArgumentType.integer())
                                .then(Commands.argument("y", IntegerArgumentType.integer())
                                        .then(Commands.argument("z", IntegerArgumentType.integer())
                                                .executes(context -> queueMobStrike(context))))));
    }

    private static int queueMobStrike(CommandContext<CommandSourceStack> context) {
        Identifier entityId = Identifier.tryParse(StringArgumentType.getString(context, "entity_type"));
        if (entityId == null) {
            return 0;
        }

        EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.getOptional(entityId).orElse(null);
        if (entityType == null) {
            return 0;
        }

        return queueStrike(context, Mode.MOB, entityType);
    }

    private static int queueStrike(CommandContext<CommandSourceStack> context, Mode mode, EntityType<?> mobType) {
        ServerLevel level = context.getSource().getLevel();
        int centerX = IntegerArgumentType.getInteger(context, "x");
        int targetY = IntegerArgumentType.getInteger(context, "y");
        int centerZ = IntegerArgumentType.getInteger(context, "z");

        if (targetY < level.getMinY() || targetY > level.getMaxY()) {
            return 0;
        }

        List<Payload> strike = new ArrayList<>();
        int launchY = Math.min(level.getMaxY() - 2, targetY + 28);
        switch (mode) {
            case NUKE, DRIPSTONE, ARROW, CART -> {
                for (int layer = 0; layer < 4; layer++) {
                    addRings(strike, level, mode, centerX, launchY - layer * 4, centerZ, mobType);
                }
            }
            case STAB -> {
                for (int y = Math.min(level.getMaxY() - 2, targetY + 20); y > level.getMinY() + 1; y -= 4) {
                    strike.add(new Payload(level, mode, centerX, y, centerZ, mobType));
                }
            }
            case SUPER_STAB -> {
                for (int y = launchY; y > level.getMinY() + 1; y -= 16) {
                    addRings(strike, level, mode, centerX, y, centerZ, mobType);
                }
            }
            case MOB -> addRings(strike, level, mode, centerX,
                    Math.min(level.getMaxY() - 2, targetY + 20), centerZ, mobType);
        }

        if (strike.isEmpty() || PENDING.size() + strike.size() > MAX_PENDING_PAYLOADS) {
            return 0;
        }

        PENDING.addAll(strike);
        return 1;
    }

    private static void addRings(List<Payload> strike, ServerLevel level, Mode mode, int centerX, int y, int centerZ, EntityType<?> mobType) {
        for (int radius : RING_RADII) {
            int points = radius == 0 ? 1 : (int) Math.ceil(Math.PI * 2.0 * radius / 4.0);
            for (int point = 0; point < points; point++) {
                double angle = Math.PI * 2.0 * point / points;
                int x = centerX + (int) Math.round(Math.cos(angle) * radius);
                int z = centerZ + (int) Math.round(Math.sin(angle) * radius);
                strike.add(new Payload(level, mode, x, y, z, mobType));
            }
        }
    }

    private static void processPending() {
        for (int spawned = 0; spawned < PAYLOADS_PER_TICK && !PENDING.isEmpty(); spawned++) {
            spawn(PENDING.removeFirst());
        }
    }

    private static void spawn(Payload payload) {
        ServerLevel level = payload.level();
        double x = payload.x() + 0.5;
        double y = payload.y();
        double z = payload.z() + 0.5;

        switch (payload.mode()) {
            case NUKE -> spawnTnt(level, x, y, z, 80);
            case STAB, SUPER_STAB -> spawnTnt(level, x, y, z, 1);
            case MOB -> spawnMob(level, payload.mobType(), x, y, z);
            case DRIPSTONE -> FallingBlockEntity.fall(level, new BlockPos(payload.x(), payload.y(), payload.z()),
                    Blocks.POINTED_DRIPSTONE.defaultBlockState());
            case ARROW -> spawnArrow(level, x, y, z);
            case CART -> spawnCart(level, x, y, z);
        }
    }

    private static void spawnTnt(ServerLevel level, double x, double y, double z, int fuse) {
        PrimedTnt tnt = new PrimedTnt(level, x, y, z, null);
        tnt.setFuse(fuse);
        level.addFreshEntity(tnt);
    }

    private static void spawnMob(ServerLevel level, EntityType<?> type, double x, double y, double z) {
        Entity entity = type.create(level, EntitySpawnReason.COMMAND);
        if (entity instanceof Mob mob) {
            mob.setPos(x, y, z);
            mob.setAggressive(true);
            level.addFreshEntity(mob);
        }
    }

    private static void spawnArrow(ServerLevel level, double x, double y, double z) {
        Arrow arrow = EntityTypes.ARROW.create(level, EntitySpawnReason.COMMAND);
        if (arrow != null) {
            arrow.setPos(x, y, z);
            arrow.setBaseDamage(1000.0);
            arrow.shoot(0.0, -1.0, 0.0, 2.5F, 0.0F);
            level.addFreshEntity(arrow);
        }
    }

    private static void spawnCart(ServerLevel level, double x, double y, double z) {
        MinecartTNT cart = EntityTypes.TNT_MINECART.create(level, EntitySpawnReason.COMMAND);
        if (cart != null) {
            cart.setPos(x, y, z);
            cart.primeFuse(null);
            level.addFreshEntity(cart);
        }
    }

    private enum Mode {
        NUKE,
        STAB,
        SUPER_STAB,
        MOB,
        DRIPSTONE,
        ARROW,