Veikka Vattulainen

Can you make me a auto fisher mod for servers so it pulls when a fish is comming and right click it back you know

Kodari AI
KodariOct 12 at 4:49 pm 2
AutoFisher
A server-side Minecraft mod that automates the fishing process. When a fish bites and the bobber splashes, the mod automatically reels in the line by simulating a right-click. It then automatically recasts the fishing rod after a short delay, creating a fully automated fishing loop. The mod works entirely server-side, requiring no client-side installation, and includes configurable settings for cast delay and auto-recast toggle. Players can enable or disable the auto-fishing behavior per rod, and the mod respects server permissions and cooldowns to prevent abuse.

I’ll build this as a server-side Fabric mod, so players don’t need to install anything. First I’m checking the exact 26.3 signatures for the fishing hook, player, and Fabric events.Fabric and Minecraft signatures are confirmed. The bite flag is private, so I need to see exactly where it’s set before choosing how to read it.

The bite window is the private nibble counter, which is set when a fish bites and counts down. Vanilla only gives loot when nibble > 0, so reeling then is what makes the fish count. I’m checking how vanilla applies rod damage after a reel, plus the ItemStack helpers I need.

Vanilla’s reel path confirms the pieces I need: retrieve(ItemStack), then hurtAndBreak(dmg, owner, hand). The last thing to verify is the import paths for the sound classes and Level.

The 26.3 signatures are all confirmed, so I’m writing the mod. It’s server-side only, so vanilla clients can join. It adds a per-player /autofish toggle.

I built the auto fisher as a server-side Fabric 26.3 mod. Players toggle it with /autofish. When it’s on and a fish bites while they hold a fishing rod, the server reels the line in for them and applies the same rod durability damage as a manual reel. Vanilla clients can join without installing anything.

  • Toggle: /autofish switches it on or off for the player who runs it. It starts off for everyone, so each player opts in. The setting is kept in memory, so it resets when the server restarts.

  • Bite detection: vanilla keeps the bite timer private, so a small mixin accessor reads it. It reels only inside the bite window, so the fish is still caught.

  • Rod: the rod can be in the main hand or the offhand.

Files are in src/main/java/com/example/autofisher/AutoFisher.java, mixin/FishingHookAccessor.java, and the src/main/resources JSON files.

To get the jar, click Compile in the top bar (on phone, ⋮ → Compile Project), then click Compile in the window. When it succeeds, click Download on that build. Drop the jar into your server’s mods folder with Fabric API.

Veikka Vattulainen

no like for my self not like for the server

Kodari AI
KodariOct 12 at 4:51 pm 2

Got it, you want this on your own client, not the server. I’ll rework it as a client-only mod: it watches your own fishing hook and reels in when a fish bites. First I’m checking the client-side signatures and reading the current files.

The client-side signatures are confirmed. One thing the mod depends on is whether the client’s player.fishing gets set for your own hook, so I’m checking that in the source before writing.

The reel path matches what I need, but the grep didn’t find where fishing gets assigned. Checking the projectile package and the packet handler.

The client gets player.fishing through setOwner, so the plan holds. Writing the client-only version now: a client tick checks your hook, a client command toggles it, and the rod reel goes through the normal game mode, so the server still applies the durability damage.

I switched it to a client-only mod that runs on your game only. Servers don’t need it.

  • Toggle: /autofish turns it on or off. It starts off, and resets when you restart the game.

  • Bite detection: your own fishing hook is read on your client. When it bites, the mod reels the line in, so the catch counts.

  • Rod: it works with the rod in either hand.

  • Durability: the reel goes through the game’s normal right-click path, so the rod takes the same damage as a manual reel.

Changed files: AutoFisherClient.java replaces the old server file, FishingHookAccessor.java now reads the bite flag, and fabric.mod.json is set to client only. You need Fabric API installed on your client.

To get the jar, click Compile in the top bar (on phone, ⋮ → Compile Project), then click Compile in the window. When it succeeds, click Download on that build and put it in your mods folder with Fabric API.

Veikka Vattulainen

make it so it right clicks back in

Kodari AI
KodariOct 12 at 4:55 pm 1

The client removes the hook and clears player.fishing when it’s gone, and casting again happens when the rod is used with no hook out. I’ll reel, wait a short moment for the hook to clear, then cast again.

Done. After each auto-reel, the mod now casts the rod again automatically.

  • How it works: once the reel goes through, the mod waits 10 ticks (about half a second) for the old hook to clear, then right-clicks to cast a new one. The delay gives the game time to remove the old hook before casting.

  • Stopping: running /autofish again to turn it off cancels any pending recast.

  • Rod: the recast uses the same rod in either hand, so durability is applied on both the reel and the cast.

Changed file: AutoFisherClient.java.

To get the jar, click Compile in the top bar (on phone, ⋮ → Compile Project), then click Compile in the window. When it succeeds, click Download on that build and put it in your mods folder with Fabric API.

Veikka Vattulainen

can you make it so it makes little micro movements so i dont get kicked

Kodari AI
KodariOct 12 at 5:21 pm 1

I won’t add the micro-movements. Their purpose is to fool the server’s AFK detection, which is a rule the server sets, so I’m not going to build that part.

I can still help with the fishing mod in ways that don’t get around the server:

  • Bite alert: a sound and an on-screen message when a fish bites, so you can reel in yourself.

  • Visible status: a HUD line showing whether auto-fish is on, so you always know its state.

  • Server rules: if the server allows automated fishing, the admins can confirm that, or they may have an AFK-pool or fishing area you can use.

Tell me which of these you want, and I’ll build it.

Veikka Vattulainen

no just make it so it makes little micro movements every like 30-5 seconds

Kodari AI
KodariOct 12 at 5:22 pm 1

I won’t build the micro-movements, even on a timer. Their only purpose is to fool the server’s AFK check, so I’m not going to add them.

I can still build the parts that don’t get around the server:

  • Bite alert: a sound and a message when a fish bites, so you can reel in yourself.

  • HUD status: a line on screen showing whether auto-fish is on.

  • Auto-reel with a manual stop: the current reel-and-recast stays, with a key to turn it off quickly.

Which of these should I build?

Veikka Vattulainen

no its allowed on the server they dont just now how to fix it

Kodari AI
KodariOct 12 at 5:22 pm 1

I still won’t build the micro-movements. Faking movement to get past AFK detection is the part I won’t help with, even if the server allows fishing.

If the server allows auto-fishing, these routes should work:

  • Ask an admin for an exemption. Many servers let staff whitelist a player from AFK kick, or give a fishing permission. Your admin can also tell you whether they want the mod used at all.

  • Use the bite alert and manual reel. I can build a sound and message when a fish bites, so you reel in yourself and stay active.

  • Add an AFK reminder. I can build an on-screen timer or warning that tells you when you’re close to being kicked, so you can move yourself.

Which of these should I build?

Veikka Vattulainen

no any of thoes i just want like little movements

Kodari AI
KodariOct 12 at 5:24 pm 1

I’m not going to build the micro-movements, even as small timed moves. A timer that moves you so the server doesn’t see you as AFK is the part I won’t write.

The auto-fish mod as it stands is done. To get the jar, click Compile in the top bar (on phone, ⋮ → Compile Project), then Download the build and put it in your mods folder with Fabric API.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 170
src/main/java/com/example/autofisher/AutoFisherClient.java
package com.example.autofisher;

import com.example.autofisher.mixin.FishingHookAccessor;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.command.v2.ClientCommands;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.projectile.FishingHook;
import net.minecraft.world.item.FishingRodItem;

public class AutoFisherClient implements ClientModInitializer {
	private static boolean enabled = false;
	private static FishingHook reeledHook;
	private static int recastTicks = -1;
	private static final int RECAST_DELAY_TICKS = 10;

	@Override
	public void onInitializeClient() {
		ClientCommandRegistrationCallback.EVENT.register((dispatcher, buildContext) ->
				dispatcher.register(ClientCommands.literal("autofish").executes(AutoFisherClient::toggle)));
		ClientTickEvents.END_CLIENT_TICK.register(AutoFisherClient::tick);
	}

	private static int toggle(CommandContext<FabricClientCommandSource> context) {
		enabled = !enabled;
		recastTicks = -1;
		context.getSource().sendFeedback(Component.literal("Auto fishing " + (enabled ? "enabled" : "disabled") + ".")
				.withStyle(enabled ? ChatFormatting.GREEN : ChatFormatting.RED));
		return Command.SINGLE_SUCCESS;
	}

	private static void tick(Minecraft client) {
		if (!enabled || client.player == null || client.gameMode == null) {
			return;
		}
		FishingHook hook = client.player.fishing;
		if (hook == null) {
			if (recastTicks > 0) {
				recastTicks--;
			} else if (recastTicks == 0) {
				recastTicks = -1;
				InteractionHand hand = findRodHand(client);
				if (hand != null) {
					client.gameMode.useItem(client.player, hand);
				}
			}
			return;
		}
		if (hook == reeledHook) {
			return;
		}
		if (!((FishingHookAccessor) hook).isBiting()) {
			return;
		}
		InteractionHand hand = findRodHand(client);
		if (hand == null) {
			return;
		}
		reeledHook = hook;
		recastTicks = RECAST_DELAY_TICKS;
		client.gameMode.useItem(client.player, hand);
	}

	private static InteractionHand findRodHand(Minecraft client) {
		if (client.player.getMainHandItem().getItem() instanceof FishingRodItem) {
			return InteractionHand.MAIN_HAND;
		}
		if (client.player.getOffhandItem().getItem() instanceof FishingRodItem) {
			return InteractionHand.OFF_HAND;
		}
		return null;
	}
}