Jump to content

Recommended Posts

Posted

Hello, I am working on an item and I need to do something only once while the right click is pressed.

I looked at some vanilla items and some of them were calling OnItemStoppedUsing, I looked at some forge tutorials, the rifle tutorial is using the same function.

When I use it in my mod it never gets called, do I need to extend something special for it to work?

Posted

I'd recommend looking at the code in the Item class for that method, it should have the code for making the player slow down, use an at override method on the one in your class and remove that line of code slowing the player down. Should suffice for your purposes. :)

Posted

I found the method but, overriding it, that never came into my mind, thank you for the idea:) Why it was slowing down the player it was because it was making the player have the same things as when eating, holding a sword, drinking potions.

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.