You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
You can probably use KeyMapping.setDown(key, pDown)
this however only emulates the key being held down (works for mouse buttons too), and all the flow on effects will happen (ie block breaking)
if you only want it to happen when the client player is looking at something you can subscribe to client tick event and check if Minecraft.getInstance().hitResult instanceof BlockHitResult
You will probably have to do some research into packets, as the server tends to send those types of updates as packets. If you want to actually trigger anything when those packets are received (if they exist) you will have to set the client players packet listener impl to your own custom one or write some mixins. Preferably the former as it is a much friendlier and flexible approach whereas mixins are just downright evil.
Okay so for anyone experiencing this issue I have found the solution after many hours, my computer was attempting to run another program on the same port (25565) and preventing java from hosting there. To solve:
open cmd as admin and type
netstat -aon | findstr 25565
if there is anything there type
taskkill /PID <number at listening> /F
The number is usually 4-6 digits. Then run your server again and it will start normally.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.