March 20Mar 20 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
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.