Posted October 22, 20159 yr I need to be able to handle mouse input from the player and was wondering what the best way for that is - using the MouseEvent works well, but I need for the code to run every tick so long as the left click / right click is down. I also tried using the ClientTickEvent to check Mouse.isButtonDown() and event.phase, but that seemed too buggy and didn't send my packet every time. I would appreciate any input on this. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
October 22, 20159 yr Author I'm guessing this would be correct: @SubscribeEvent public void onEvent(ClientTickEvent event) { if(event.phase.equals(Phase.START)) { if(Mouse.isButtonDown(0)) { UtilityMessage.sendMessageToServer(new MessageFire()); } } } Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
October 22, 20159 yr Don't send packets per tick. Do it once on Press (true) and unpress (false). Store bool in IEEP. 1.7.10 is no longer supported by forge, you are on your own.
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.