Posted August 16, 20178 yr So am I right in saying that ClientTickEvent should fire twice each tick? 1 for the start phase and 1 for the end phase. Since I have found that it fires twice per phase each tick, I simply made it print the phase and I get this: [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START Here's my event handler code: @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { System.out.println(event.phase); } This means that even after checking for a phase everything is run twice in the same tick. Which seemingly I can't prevent as any checks to prevent things from running a second time do not work as they happen at the same time. If I am wrong about how the event works and that it firing twice per phase is how it is supposed to work how should I prevent code being run twice in the end or start phase?
August 16, 20178 yr Author Now that you mention where it's been registered... It's all my fault just checked again where I had it registered and well it was registered in both the init and postInit, now it makes sense why it was firing twice So no problem here everything is working fine
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.