Gone fishin’

Fishing in Minecraft isn’t exactly difficult. Once you craft a fishing rod, it’s mostly a question of waiting for something to bite, and right-clicking to reel it in, then right-clicking a second time to cast the line back out again. It makes “easy” look difficult.

Unfortunately, until you acquire a fully-enchanted fishing rod (or at least Lure III), it’s also about as engaging as watching paint dry, but still requires at least a good part of your attention, to avoid missing any fish.

Yes, it’s a sterile, isolated pool. No, that doesn’t matter. #minecraftlogic

Fishing in Minecraft does, however, have in-game advantages. There’s lots of stuff in there — some of which (including important “treasure” enchantments such as Mending) can’t easily be found in other ways. And it’s fun to see what new rare items have been added in recent versions of the game.

Fortunately, the fishing algorithm is simple enough that it can be readily automated:

  • Wait for a loud sound (the “fish” biting);
  • Right-click the mouse;
  • Wait about 250ms;
  • Click it again to re-cast;
  • Wait about two seconds to re-arm.

The Arduino Leonardo is an Arduino board specifically designed to allow the easy generation of mouse and keyboard input to a PC. With a few lines of C++ code, the Leonardo (attached via USB) can emulate a mouse and send right or left clicks and/or mouse movement commands.

A short sketch and attached microphone sensor later, and the Leonardo is on duty in front of one of the speakers, listening for the sound of a strike. Now the fish catch themselves.

The microphone sensor is from one of those cheapo sensor kits on Amazon.
I forget which one, but it doesn’t really matter.

It’s a temporary project (and the $30 or so cost for the Leonardo is a bit expensive for a dedicated Minecraft fishing robot) — but it’s a fun example of what can be done on a whim with even very simple microcontroller electronics. Technologies like USB have many layers of complexity. They make lots of things possible, but are inherently complex to use, out of the box. Progress speeds up when those technologies are packaged in easy-to-use modules.

Civilization advances by extending the number of important operations which we can perform without thinking about them.

–Alfred North Whitehead

This entry was posted in Analog, Arduino, Audio, C, Digital, Games, Minecraft. Bookmark the permalink.

Leave a Reply