Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fishing? (protocol question regarding start and stop of item usage) #502

Closed
Simran-B opened this issue Jun 18, 2018 · 4 comments
Closed
Labels
a:new-feature Request for a new feature in:inventory-handling Related to Inventory handling resolved The issue has been resolved

Comments

@Simran-B
Copy link

Hi everyone,

there's a popular AFK fish & XP farm design which exploits the game mechanics pretty clever to fully automate fishing.

In short: it uses some redstone, an iron door and a noteblock so that all you need is a mouse down event for the RMB (use item) while aiming at the right spot. Due to the clever design, the durability of the fishing rod is not unnecessarily diminished, but only reels in whatever you caught in the moment you catch it. The catch is collected by a hopper and stuffed into a chest.

This works very nicely in the normal game client with an enchanted fishing rod (especially Mending is required to make it last infinitely). I wrote a little script in AutoIt to send the required mouse down event, because taping down the physical mouse button seemed pretty stupid to me.

Now, I really wonder how this could be ported to MC console client. I went through the protocol description and found Use Entity which seems to be relevant here. There are no begin and end flags however. For entering a mine cart etc., it is a single action, but bows and fishing rods kinda have multiple states.

For instance, the bow charges up in power in three intervals. Because there doesn't seem to be anything in the protocol for that, does it mean this is handled on the client side completely? Wouldn't it allow cheaters to always shoot with maximum power without properly charging the bow (effectively firing more rapidly while dealing maximal damage)?

Coming back to the fishing scenario, I'd like to know if the fish farm design would be completely irrelevant for a console client. Does it only trick the regular game client to automatically catch fish? Or is there a "bite" event coming from the server and another packet that tells you what you caught? I can't imagine that this happens on client side, as it would be really easy to manipulate to catch whatever you want, like a /give command.

So, if there's no way to directly translate the mouse down event to network packets, how else could this be implemented? Is there an easy way to intercept MC traffic to analyze fish farming with the game client? (Couldn't get Wireshark with Npcap and its Loopback Adapter to work for a local MC serve so far)

@ORelio
Copy link
Member

ORelio commented Nov 15, 2018

Hi,

Sorry about the delay for such a detailed issue. MCC cannot click and interact with entities at the moment, and will probably not soon unless someone very motivated wants to implement all the prerequisites:

The bow seems to be handled in Player digging packet.

So long story short, Yes, this can be implemented in MCC, but it requires much work beforehand.

@ReinforceZwei
Copy link
Member

ReinforceZwei commented Mar 22, 2020

Hello,

Just want to announce that I have figured out how to fish with MCC (including use an item, detect if a fish is caught)
Here is a little prove screenshot:
image

But there are a lots of problems still need to be solved.
Such as how to know if the fishing hook was owned by the client player so that we don't react to other player's fishing hook, where the water are located, etc...

@Mhowser
Copy link
Contributor

Mhowser commented Mar 22, 2020

I know this is Java, but this is how Wurst does it https://github.com/Wurst-Imperium/Wurst7/blob/master/src/main/java/net/wurstclient/hacks/AutoFishHack.java

@ORelio ORelio added in:inventory-handling Related to Inventory handling resolved The issue has been resolved and removed waiting-for:contributor Contributions needed and welcome :) labels Mar 29, 2020
@ORelio
Copy link
Member

ORelio commented Mar 29, 2020

Since the AutoFish bot is now implemented, I'll close this issue 😉

@ORelio ORelio closed this as completed Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:new-feature Request for a new feature in:inventory-handling Related to Inventory handling resolved The issue has been resolved
Projects
None yet
Development

No branches or pull requests

5 participants