Jump to content

'onItemRightClick' being called right after 'onItemUse' is called


UntouchedWagons

Recommended Posts

In my item's onItemUse method, some data about the tile entity that the player has right clicked on while sneaking is saved to the itemstack. If a player right clicks the item while sneaking and not looking at anything, this data is cleared. However when the player sneak-right clicks the tile entity, the onItemUse method is called then onItemRightClick is called. I want to stop the later from happening. Is this controlled by the return value of onItemUse or something else?

I like trains.

Link to comment
Share on other sites

    @Override
    public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
        if (world.isRemote)
            return true;

 

There we go. It works now.

I like trains.

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.