raiveniee

a vanilla fishing rod with 1 durability, when wielded, on the exact location your looking at, it rains a barrage of sonically charged shriek from above, just enough height to strike down at the floor hitting anyone under, that encloses for over 32 blocks wide and long, just like a circle from an orbital strike cannon. and each one of the charged shriek from the raining barrage deals 7 hearts of damage. ported to 1.21.11 and fabric

Kodari AI
KodariNov 8 at 10:12 am 6
OrbitalShriekStrike
Adds a custom vanilla fishing rod with 1 durability. When wielded and right-clicked, it targets the exact block the player is looking at. From above, a barrage of sonic shriek projectiles rains down in a 32-block radius circular area, striking the ground and damaging all entities underneath. Each shriek deals 7 hearts (14 damage) per hit. Built for Minecraft 1.21.11 on Fabric, implementing custom item behavior, projectile spawning, area-of-effect damage, and durability consumption.
  1. Add a one-use fishing rod that targets the block you’re looking at.

  2. Rain sonic strikes across a 32-block-wide circle, dealing seven hearts per hit.

  3. Add a survival recipe and the rod’s visuals.

Added the Orbital Fishing Rod for Fabric 1.21.11. Right-click a block within 128 blocks to unleash a one-second sonic barrage across a 32-block-wide circle. Each strike deals 7 hearts before damage mitigation; the rod breaks after use.

Craft it with a fishing rod, sculk catalyst, echo shard, and sculk shrieker.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
10 209
src/main/java/com/kodari/orbitalfishing/OrbitalFishing.java
package com.kodari.orbitalfishing;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.FishingRodItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.Heightmap;

public class OrbitalFishing implements ModInitializer {
    private static final RegistryKey<Item> ROD_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of("orbitalfishing", "orbital_rod"));
    private static final Item ROD = Registry.register(Registries.ITEM, ROD_KEY, new OrbitalRod(new Item.Settings().registryKey(ROD_KEY).maxDamage(1)));
    private static final List<Barrage> BARRAGES = new ArrayList<>();

    @Override
    public void onInitialize() {
        RegistryKey<ItemGroup> tools = RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of("minecraft", "tools_and_utilities"));
        ItemGroupEvents.modifyEntriesEvent(tools).register(entries -> entries.add(ROD));
        ServerTickEvents.END_WORLD_TICK.register(OrbitalFishing::tick);
    }

    private static void tick(ServerWorld world) {
        Iterator<Barrage> iterator = BARRAGES.iterator();
        while (iterator.hasNext()) {
            Barrage barrage = iterator.next();
            if (barrage.world != world) continue;
            for (int i = 0; i < 4; i++) {
                double angle = world.getRandom().nextDouble() * Math.PI * 2;
                double radius = Math.sqrt(world.getRandom().nextDouble()) * 16;
                double x = barrage.center.x + Math.cos(angle) * radius;
                double z = barrage.center.z + Math.sin(angle) * radius;
                double y = world.getTopY(Heightmap.Type.WORLD_SURFACE, (int) Math.floor(x), (int) Math.floor(z));
                for (int height = 0; height <= 10; height += 2) {
                    world.spawnParticles(ParticleTypes.SONIC_BOOM, x, y + height, z, 1, 0, 0, 0, 0);
                }
                world.playSound(null, x, y, z, SoundEvents.ENTITY_WARDEN_SONIC_BOOM, SoundCategory.PLAYERS, 0.5f, 1.0f);
                for (var entity : world.getOtherEntities(null, new Box(x - 1.5, y - 1, z - 1.5, x + 1.5, y + 3, z + 1.5), e -> e.isAlive())) {
                    entity.damage(world, barrage.attacker.getDamageSources().sonicBoom(barrage.attacker), 14.0f);
                }
            }
            if (--barrage.ticks == 0) iterator.remove();
        }
    }

    private static class Barrage {
        final ServerWorld world;
        final PlayerEntity attacker;
        final Vec3d center;
        int ticks = 20;

        Barrage(ServerWorld world, PlayerEntity attacker, Vec3d center) {
            this.world = world;
            this.attacker = attacker;
            this.center = center;
        }
    }

    private static class OrbitalRod extends FishingRodItem {
        OrbitalRod(Item.Settings settings) {
            super(settings);
        }

        @Override
        public ActionResult use(World world, PlayerEntity user, Hand hand) {
            HitResult target = user.raycast(128, 1.0f, false);
            if (target.getType() != HitResult.Type.BLOCK) return ActionResult.PASS;
            if (world instanceof ServerWorld serverWorld) {
                BARRAGES.add(new Barrage(serverWorld, user, target.getPos()));
                ItemStack stack = user.getStackInHand(hand);
                stack.damage(1, user, hand);
            }
            return ActionResult.SUCCESS;
        }
    }
}