Joshua Oh

can you make a mod where there is a custom fishing rod and when you pull it, it summons rain

Kodari AI
KodariOct 27 at 3:45 am 1
RainSummoningRod
A custom fishing rod item that summons rain when cast. When a player casts the rod into water or open air, the plugin detects the cast action and triggers a rain event in the current world. The rod has a cooldown period to prevent spam, and each successful cast displays a chat message to the player confirming the rain summon. The plugin registers a custom item with a unique identifier, hooks into fishing rod cast events, checks cooldown timestamps, and applies the weather effect using the world API. Players can obtain the rod through a simple command that grants them the item. The plugin is lightweight, requires no external dependencies beyond the standard Bukkit/Spigot API, and includes configurable cooldown duration and rain duration settings in a config file.
  • Create a Paper plugin with a /rainrod command that gives the player a tagged custom fishing rod.

  • Detect when that rod is reeled in and start rain in the player’s world.

  • Add the plugin metadata and Gradle setup.

[Generation stopped]

Joshua Oh

can you make a mod where there is a custom fishing rod and when you pull it, it summons rain. Can i be fabric

Kodari AI
KodariOct 27 at 3:51 am 3
  1. Convert the project from the generated Paper plugin setup to a Fabric mod.

  2. Implement a custom fishing rod that starts rain when reeled in.

  3. Update Fabric metadata and dependencies to match the project’s Minecraft version.

Converted it to a Fabric mod for Minecraft 1.20.4. Use /rainrod as an operator to get the custom rod; reeling it in starts rain for five minutes.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 159
src/main/java/com/kodari/rainrod/RainRodPlugin.java
package com.kodari.rainrod;

import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.entity.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

public final class RainRodPlugin implements ModInitializer {
    private static final String RAIN_ROD_TAG = "rainrod:is_rain_rod";

    @Override
    public void onInitialize() {
        CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) ->
                registerRainRodCommand(dispatcher));
    }

    private void registerRainRodCommand(CommandDispatcher<ServerCommandSource> dispatcher) {
        dispatcher.register(CommandManager.literal("rainrod")
                .requires(source -> source.hasPermissionLevel(2))
                .executes(context -> {
                    ServerPlayerEntity player = context.getSource().getPlayerOrThrow();
                    ItemStack rod = createRainRod();
                    if (!player.getInventory().insertStack(rod)) {
                        player.dropItem(rod, false);
                    }
                    player.sendMessage(Text.literal("You received the Rain Rod!")
                            .formatted(Formatting.AQUA), false);
                    return 1;
                }));
    }

    private static ItemStack createRainRod() {
        ItemStack rod = new ItemStack(Items.FISHING_ROD);
        rod.setCustomName(Text.literal("Rain Rod").formatted(Formatting.AQUA));
        rod.getOrCreateNbt().putBoolean(RAIN_ROD_TAG, true);
        return rod;
    }

    public static boolean isRainRod(ItemStack item) {
        NbtCompound nbt = item.getNbt();
        return item.isOf(Items.FISHING_ROD) && nbt != null && nbt.getBoolean(RAIN_ROD_TAG);
    }
}