Posted March 26, 20169 yr How would I get the amount of ticks passed between two triggers? (e.g. a onItemRightClick trigger) Example: @Override public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer playerIn, EnumHand hand) { int ticks = getTicks(); // gets ticks since the last time getTicks() was called System.out.println(ticks); return new ActionResult(EnumActionResult.PASS, stack); } How would I make the getTicks() method?
March 27, 20169 yr Author World#getTotalWorldTime gives you the age of the world in ticks, it increments every tick. So remember that value and return the difference between the remembered value and the current value. Thanks, but I found a better way to do this for my situation. I use the Item#onUpdate method and just store the ticks passed as damage values.
March 27, 20169 yr World#getTotalWorldTime gives you the age of the world in ticks, it increments every tick. So remember that value and return the difference between the remembered value and the current value. Thanks, but I found a better way to do this for my situation. I use the Item#onUpdate method and just store the ticks passed as damage values. That's not better, that's worse. Now the itemstack needs to update every tick and will cause a jiggle as if the player is switching items. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.