Posted July 12, 201510 yr Hey, I'm currently having an issue where if you hold right click for longer than maybe half a second, the if statement I use to detect right clicks is constantly activating. Here is my if statement: public ItemStack onItemRightClick(ItemStack itemstack, World par2World, EntityPlayer par3EntityPlayer) { if(itemstack.stackTagCompound.getInteger("enabled") == 1) { itemstack.stackTagCompound.setInteger("enabled", 0); System.out.println("Was Enabled, now Disabled"); return itemstack; } else { itemstack.stackTagCompound.setInteger("enabled", 1); System.out.println("Was Disabled, now Enabled"); return itemstack; } } I was wondering if there was something similar to onItemRightClick but instead detects the opposite, when I'm not right clicking with the item (Which I would then make a variable that utilizes it).
July 12, 201510 yr you could store when it was last pressed and then ignore it for a specific amount of time(ticks or time(for laggy servers)).
July 14, 201510 yr I don't know whether it's the preferred way to do it in Minecraft, but I know OpenGL has its own I/O system for that kind of thing catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
July 14, 201510 yr Then you can use the tick update event for the player catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
July 14, 201510 yr Try using mouse events. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
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.