Jump to content

onItemRightClick called twice - Duplicate entities as result


Blir

Recommended Posts

This is my first Forge mod, basically it lets you craft ender eyes together with ores into these "Eyes of Prospecting" that when you right click, they fly towards the ore you crafted it with rather than a stronghold. I copied a lot of the code over from ItemEnderEye & EntityEnderEye since I wouldn't know how to do a lot of it. Everything works as expected, except when you right click, the onItemRightClick method is called twice. This creates two Eyes of Prospecting, where one eye just floats there and never goes away and the other eye acts as expected. However, this only happens sometimes.

 

ItemEyeOfProspecting.java:

http://paste.minecraftforge.net/view/44e4c778

 

In the Item file, if you remove lines 74-77, it happens every time, so I'm guessing that's the bit of code that ItemEnderEye uses to prevent this happening, but it doesn't seem to be working for me.

 

EntityEyeOfProspecting.java:

http://paste.minecraftforge.net/view/2112fa4c

 

EnderProspecting.java (main mod class):

http://paste.minecraftforge.net/view/022bc3cf

 

Any help is appreciated, thanks in advance.

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.