Jump to content

[1.7.10] How to detect when Right Click is not pressed.


noahc3

Recommended Posts

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).

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.