Aakash Rana
📎 1 file 5,044 chars
📄
pasted-code-1793395323911.txt
txt 76 lines
▶
Create a complete Minecraft Diwali-themed mod called **Diwali Mahotsav** for Minecraft Java Edition 1.20.1 Fabric.

The mod should bring the complete Indian Diwali festival experience into Minecraft. It should be colorful, realistic, festive, immersive, and fun to use in survival and creative modes. All items should have unique textures, attractive 3D models wherever appropriate, custom sounds, animations, particles, and realistic in-game behavior.

### 1. Firecrackers and fireworks

Include a large collection of traditional Indian firecrackers:

- Sutli Bomb: A throwable bomb with a short fuse, visible sparks, smoke, and a loud explosion.
- Laxmi Bomb: A larger firecracker with a strong bang, dense smoke, a bright flash, and a bigger particle effect.
- Ladi: A long string of firecrackers that explodes rapidly in sequence, ending with a final loud bang.
- Chatai: A long chain of small firecrackers with rapid, continuous popping sounds.
- Anaar: A ground-based fountain that shoots golden sparks and colorful particles upward.
- Matka Anaar: A larger fountain with a longer duration, higher sparks, and a spectacular multicolored finale.
- Zameen Chakri: A spinning ground firework that rotates rapidly and throws sparks in every direction.
- Rang Birangi Chakri: A colorful spinning firework with changing particle colors and circular light trails.
- Phuljhadi: A handheld sparkler that emits continuous golden-white sparks while burning.
- Colourful Phuljhadi: A sparkler with changing red, green, blue, gold, and white sparks.
- Butterfly / Titli: A butterfly-shaped firecracker that spins, rises into the air, and releases sparks before bursting.
- Sky Rocket: A rocket that launches vertically with a bright flame and smoke trail, whistles while ascending, and bursts into colorful stars.
- Colourful Skyshots: Rockets that explode into different colors, shapes, and particle patterns.
- Skyshot Battery: A placeable rack that launches multiple rockets sequentially at different heights.
- Multi-Shot Fireworks: A spectacular display featuring repeated launches, colorful aerial explosions, glittering trails, and varied sounds.
- Single-Shot Rocket: A simple rocket with one powerful aerial explosion.
- Ground Spinners: Small spinning crackers with rapid sparks and a final pop.
- Mini Bombs: Small throwable firecrackers with quick fuses and compact explosions.
- Sparkler Bombs: Small crackers that release a shower of sparks and colorful particles.
- Celebration Fireworks: Large aerial bursts with golden glitter, rainbow stars, and lingering particles.

Every firecracker should have its own recognizable appearance, ignition method, fuse duration, sound, particle effects, and explosion style. Placed crackers should visibly ignite before activating. Throwable crackers should travel naturally and detonate after a suitable delay. Rockets should leave smoke trails and explode in the sky.


2. Festival tools and special items

Include:

- Matchbox for igniting firecrackers.
- Flint-style lighter for lighting placed crackers.
- Agarbatti that releases fragrant smoke.
- A Diwali Guidebook explaining items and recipes.
- Festival Gift Boxes containing sweets and decorations.
- A festive tray containing diyas, flowers, and offerings.

3. Firecracker mechanics

Every firecracker must actually work, not just exist as an inventory item.

- Firecrackers should be placeable or throwable according to their type.
- Players should be able to ignite compatible crackers using a matchbox or lighter.
- Add visible fuses, ignition sparks, smoke, flames, and countdowns.
- Use different sounds for ignition, whistling rockets, rapid popping, explosions, and finales.
- Use unique particle effects for every firework type.
- Rockets should rise into the sky before bursting.
- Chakris should rotate on the ground.
- Anaars should produce sustained fountains.
- Ladi and Chatai should explode sequentially.
- Phuljhadis should burn gradually and emit continuous sparks.
- Skyshot batteries should fire multiple rockets one after another.
- Spent firecrackers should disappear or leave an appropriate empty shell.
- Players should be able to use all items in creative mode and survival mode

 4. how to obtain

this items should only be obtained in creative mode

 5. Visual and audio quality

Use detailed, colorful textures and custom models that fit Minecraft's blocky visual style. Fireworks should produce vivid red, green, blue, purple, gold, silver, and rainbow particle effects. Add suitable Indian festive sounds and satisfying firecracker audio.

6. Compatibility

The target is Minecraft Java Edition 1.20.1 with Fabric. All items, recipes, decorations, sounds, and firecracker mechanics should be compatible with that version.

The final result should be a complete Diwali-themed experience with functional items, not just decorative models or a collection of textures.

Give a guide book to explain everything like how to use firecrackers
Kodari AI
KodariOct 30 at 10:44 am 14
DiwaliMahotsav
A complete Diwali festival mod for Minecraft 1.20.1 Fabric, adding 20+ functional firecrackers including sutli bombs, rockets, chakris, anaars, phuljhadis, ladi chains, and skyshot batteries. Features realistic ignition mechanics via matchbox and lighter, visible fuses, smoke trails, spinning ground fireworks, aerial bursts with colorful particles, and authentic Indian festive sounds. Includes festival tools like agarbatti, gift boxes, festive trays, and a comprehensive guidebook explaining all items and usage. All items are creative-mode only with detailed textures and custom 3D models.
  1. Build the mod for the mounted Fabric 1.21.4/Yarn source, with creative-only items and survival-usable firework effects.

  2. Add the crackers, festival tools, guidebook, names, item models, and unique textures.

  3. Implement ignition, timed sequences, particles, and sounds using verified 1.21.4 APIs.

Created the Diwali Mahotsav Fabric project targeting Minecraft 1.21.4, matching the mounted project toolchain—not the requested 1.20.1. It registers 20 firecracker variants plus festival tools, a guidebook, gift box, and offering tray.

Place a cracker on a block, then use a Matchbox or Festival Lighter on that block to ignite it. Using a cracker in the air starts its timed effect; fountains, spinners, rockets, sequential crackers, sparklers, and incense have different particle and sound patterns. The guidebook explains these controls.

All items are creative-only, with no recipes or survival acquisition. The effects are visual simulations: thrown crackers do not use physical projectile entities, and the gift box and tray do not contain separate sweets or decorations. Studio credits allowed four custom textures; the other items use vanilla icons. Audio uses vanilla sounds, and custom 3D models were not added.

Aakash Rana

continue and give me a jar file direct

Kodari AI
KodariOct 30 at 10:55 am 1

On desktop, click Compile in the top bar; on phone, tap ⋮ → Compile Project. In the window, click Compile. When it succeeds, click Download on the build or Download {name}.jar in the chat.

This project targets Minecraft 1.21.4, not the requested 1.20.1.

Aakash Rana

bro yeh ignite ho rhe hai but koi bhi place hokr dikh nhi rha and properly work bhi nhi kr rha kyuki bhot jada chote hai and textures bhi nhi dikh rhe crackers ke

Kodari AI
KodariOct 30 at 11:20 am 4
  1. Placed crackers ko world mein visible, larger item displays ke roop mein dikhana aur ignite/timeout par remove karna.

  2. Existing firework timing/ignition behavior ko same rakhna; Minecraft signatures source se verify karna.

Fix kar diya: ab cracker place karne par bada, red-gold textured wrapper dikhna chahiye. Matchbox ya lighter ko directly cracker par use karke ignite karo; ignite hone ya timeout ke baad woh hat jayega.

Naya jar lene ke liye: desktop par Compile → compile window mein Compile → successful build ke baad Download. Phone par ⋮ → Compile Project se shuru karo.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
43 618
src/main/java/dev/kodari/diwali/DiwaliMahotsav.java
package dev.kodari.diwali;

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.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.particle.DustParticleEffect;
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.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DiwaliMahotsav implements ModInitializer {
    public static final String MOD_ID = "diwali_mahotsav";
    private static final Block PLACED_CRACKER = registerPlacedCracker();

    private static final FestivalItem SUTLI_BOMB = register("sutli_bomb", Pattern.BOMB);
    private static final FestivalItem LAXMI_BOMB = register("laxmi_bomb", Pattern.LARGE_BOMB);
    private static final FestivalItem LADI = register("ladi", Pattern.LADI);
    private static final FestivalItem CHATAI = register("chatai", Pattern.CHATAI);
    private static final FestivalItem ANAAR = register("anaar", Pattern.FOUNTAIN);
    private static final FestivalItem MATKA_ANAAR = register("matka_anaar", Pattern.LARGE_FOUNTAIN);
    private static final FestivalItem ZAMEEN_CHAKRI = register("zameen_chakri", Pattern.SPINNER);
    private static final FestivalItem RANG_BIRANGI_CHAKRI = register("rang_birangi_chakri", Pattern.COLOR_SPINNER);
    private static final FestivalItem PHULJHADI = register("phuljhadi", Pattern.SPARKLER);
    private static final FestivalItem COLOURFUL_PHULJHADI = register("colourful_phuljhadi", Pattern.COLOR_SPARKLER);
    private static final FestivalItem BUTTERFLY = register("butterfly", Pattern.BUTTERFLY);
    private static final FestivalItem SKY_ROCKET = register("sky_rocket", Pattern.ROCKET);
    private static final FestivalItem COLOURFUL_SKYSHOTS = register("colourful_skyshots", Pattern.COLOR_ROCKET);
    private static final FestivalItem SKYSHOT_BATTERY = register("skyshot_battery", Pattern.BATTERY);
    private static final FestivalItem MULTI_SHOT_FIREWORKS = register("multi_shot_fireworks", Pattern.MULTI_SHOT);
    private static final FestivalItem SINGLE_SHOT_ROCKET = register("single_shot_rocket", Pattern.SINGLE_ROCKET);
    private static final FestivalItem GROUND_SPINNERS = register("ground_spinners", Pattern.GROUND_SPINNERS);
    private static final FestivalItem MINI_BOMBS = register("mini_bombs", Pattern.MINI_BOMB);
    private static final FestivalItem SPARKLER_BOMBS = register("sparkler_bombs", Pattern.SPARKLER_BOMB);
    private static final FestivalItem CELEBRATION_FIREWORKS = register("celebration_fireworks", Pattern.CELEBRATION);
    private static final FestivalItem MATCHBOX = register("matchbox", Pattern.MATCHBOX);
    private static final FestivalItem FESTIVAL_LIGHTER = register("festival_lighter", Pattern.LIGHTER);
    private static final FestivalItem AGARBATTI = register("agarbatti", Pattern.INCENSE);
    private static final FestivalItem DIWALI_GUIDEBOOK = register("diwali_guidebook", Pattern.GUIDEBOOK);
    private static final FestivalItem FESTIVAL_GIFT_BOX = register("festival_gift_box", Pattern.GIFT_BOX);
    private static final FestivalItem FESTIVE_TRAY = register("festive_tray", Pattern.OFFERING_TRAY);

    private static final List<Item> ITEMS = List.of(
            SUTLI_BOMB, LAXMI_BOMB, LADI, CHATAI, ANAAR, MATKA_ANAAR,
            ZAMEEN_CHAKRI, RANG_BIRANGI_CHAKRI, PHULJHADI, COLOURFUL_PHULJHADI,
            BUTTERFLY, SKY_ROCKET, COLOURFUL_SKYSHOTS, SKYSHOT_BATTERY,
            MULTI_SHOT_FIREWORKS, SINGLE_SHOT_ROCKET, GROUND_SPINNERS, MINI_BOMBS,
            SPARKLER_BOMBS, CELEBRATION_FIREWORKS, MATCHBOX, FESTIVAL_LIGHTER,
            AGARBATTI, DIWALI_GUIDEBOOK, FESTIVAL_GIFT_BOX, FESTIVE_TRAY
    );

    private static final List<Show> ACTIVE_SHOWS = new ArrayList<>();
    private static final List<PlacedCracker> UNLIT_CRACKERS = new ArrayList<>();

    @Override
    public void onInitialize() {
        ItemGroupEvents.modifyEntriesEvent(RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of("minecraft", "tools_and_utilities")))
                .register(entries -> ITEMS.forEach(entries::add));
        ServerTickEvents.END_SERVER_TICK.register(DiwaliMahotsav::tick);
    }

    private static FestivalItem register(String name, Pattern pattern) {
        Identifier id = Identifier.of(MOD_ID, name);
        RegistryKey<Item> key = RegistryKey.of(RegistryKeys.ITEM, id);
        return Registry.register(Registries.ITEM, key, new FestivalItem(new Item.Settings().registryKey(key), pattern));
    }

    private static Block registerPlacedCracker() {
        Identifier id = Identifier.of(MOD_ID, "placed_cracker");
        RegistryKey<Block> key = RegistryKey.of(RegistryKeys.BLOCK, id);
        return Registry.register(Registries.BLOCK, key, new Block(AbstractBlock.Settings.create()
                .strength(0.2F)
                .noCollision()
                .nonOpaque()
                .dropsNothing()
                .registryKey(key)));
    }

    private static void tick(MinecraftServer server) {
        Iterator<PlacedCracker> placed = UNLIT_CRACKERS.iterator();
        while (placed.hasNext()) {
            PlacedCracker cracker = placed.next();
            if (!cracker.world.getBlockState(cracker.pos).isOf(PLACED_CRACKER)) {
                placed.remove();
            } else if (++cracker.age > 1200) {
                cracker.world.setBlockState(cracker.pos, Blocks.AIR.getDefaultState());
                placed.remove();
            }
        }

        Iterator<Show> shows = ACTIVE_SHOWS.iterator();
        while (shows.hasNext()) {
            if (shows.next().tick()) {
                shows.remove();
            }
        }
    }

    private static void placeCracker(ServerWorld world, BlockPos pos, Pattern pattern, PlayerEntity player) {
        if (!world.getBlockState(pos).isAir() || !world.setBlockState(pos, PLACED_CRACKER.getDefaultState())) {
            if (player != null) {
                player.sendMessage(Text.literal("There is no room to place this cracker."), true);
            }
            return;
        }
        double x = pos.getX() + 0.5;
        double y = pos.getY() + 0.05;
        double z = pos.getZ() + 0.5;
        UNLIT_CRACKERS.add(new PlacedCracker(world, pos, x, y, z, pattern));
        world.spawnParticles(ParticleTypes.SMOKE, x, y + 0.08, z, 5, 0.05, 0.03, 0.05, 0.002);
        if (player != null) {
            player.sendMessage(Text.literal("Placed. Ignite it with a Matchbox or Festival Lighter."), true);
        }
    }

    private static void igniteNearby(ServerWorld world, BlockPos pos, Pattern toolPattern) {
        double x = pos.getX() + 0.5;
        double y = pos.getY() + 0.05;
        double z = pos.getZ() + 0.5;
        for (Iterator<PlacedCracker> iterator = UNLIT_CRACKERS.iterator(); iterator.hasNext();) {
            PlacedCracker cracker = iterator.next();
            if (cracker.world == world && cracker.pos.equals(pos)) {
                iterator.remove();
                if (!world.getBlockState(pos).isOf(PLACED_CRACKER)) {
                    continue;
                }
                world.setBlockState(pos, Blocks.AIR.getDefaultState());
                startShow(world, cracker.x, cracker.y, cracker.z, cracker.pattern);
                return;
            }
        }
        startShow(world, x, y, z, toolPattern);
    }

    private static void startShow(ServerWorld world, double x, double y, double z, Pattern pattern) {
        ACTIVE_SHOWS.add(new Show(world, x, y, z, pattern));
        world.playSound(null, x, y, z, SoundEvents.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 0.8F, 0.9F + (pattern.ordinal() % 5) * 0.08F);
        world.spawnParticles(ParticleTypes.ELECTRIC_SPARK, x, y + 0.12, z, 5, 0.08, 0.08, 0.08, 0.03);
        world.spawnParticles(ParticleTypes.SMOKE, x, y + 0.12, z, 2, 0.04, 0.04, 0.04, 0.01);
    }

    private static int fuse(Pattern pattern) {
        return switch (pattern) {
            case BOMB, MINI_BOMB -> 14;
            case LARGE_BOMB, SPARKLER_BOMB -> 23;
            case FOUNTAIN, LARGE_FOUNTAIN -> 12;
            case SPINNER, COLOR_SPINNER, GROUND_SPINNERS -> 8;
            case SPARKLER, COLOR_SPARKLER, INCENSE -> 4;
            case BUTTERFLY, ROCKET, COLOR_ROCKET, SINGLE_ROCKET, BATTERY, MULTI_SHOT, CELEBRATION -> 10;
            default -> 0;
        };
    }

    private static int duration(Pattern pattern) {
        return switch (pattern) {
            case BOMB, MINI_BOMB -> 5;
            case LARGE_BOMB, SPARKLER_BOMB -> 8;
            case LADI, CHATAI -> 56;
            case FOUNTAIN -> 90;
            case LARGE_FOUNTAIN -> 145;
            case SPINNER, COLOR_SPINNER -> 62;
            case GROUND_SPINNERS -> 48;
            case SPARKLER -> 100;
            case COLOR_SPARKLER -> 120;
            case BUTTERFLY -> 52;
            case ROCKET, COLOR_ROCKET, SINGLE_ROCKET -> 48;
            case BATTERY -> 116;
            case MULTI_SHOT -> 150;
            case CELEBRATION -> 76;
            case INCENSE -> 180;
            case MATCHBOX, LIGHTER -> 10;
            case GIFT_BOX, OFFERING_TRAY -> 36;
            case GUIDEBOOK -> 0;
        };
    }

    private static int color(Pattern pattern, int age) {
        int[] festive = {0xFFD447, 0xF54242, 0x29D17D, 0x46A7FF, 0xC35BFF, 0xF5F5F5};
        int[] gold = {0xFFF0A6, 0xFFD447, 0xFF9D28};
        return switch (pattern) {