Just as the title says, I'm wondering if there is either an easy way, with ModLoader or Forge, to get when the player has right clicked? The purpose of this is for finding a way to essentially modify a base item's onItemRightClick (Not the exact method name if I remember correctly, but I don't know the exact name at the time) without actually modifying the base class itself.
I've never used Forge, which is why I ask if it has a hook for item right clicks. I know it has a variety of other hooks, I've been told even one for the interaction method for entities, but I was unable to find anything about a right click hook of sorts.
Any information would be appreciated. Thank you in advance.
Thank you for the reply, but not quite what I was asking. I need a way to tell from a non-item non-block non-entity class when the player right clicks. Namely from my Mod_**** class
The downside to that would be that there isn't a way to call it every possible moment. I attempted something similar but unless the mouse was either down or was just clicked about the time of the tick it was called in it didn't work.
The downside to that would be that there isn't a way to call it every possible moment. I attempted something similar but unless the mouse was either down or was just clicked about the time of the tick it was called in it didn't work.
Use modloaders OnTickInGame method. make sure you have the code in the load method to set the hook.
ModLoader.setInGameHook(bla bla bla);
Use modloaders OnTickInGame method. make sure you have the code in the load method to set the hook.
ModLoader.setInGameHook(bla bla bla);
Except if you do it at the better constant of 20 times per second, that's only once very 5 milliseconds.That leaves a space in-between where you can click and it won't acknowledge it. Trust me, I've tried.
I've never used Forge, which is why I ask if it has a hook for item right clicks. I know it has a variety of other hooks, I've been told even one for the interaction method for entities, but I was unable to find anything about a right click hook of sorts.
Any information would be appreciated. Thank you in advance.
Edit: Using them would be as easy as making a class that extends either the block or item class (respectively).
you need to import org.lwjgl.input.Mouse
The downside to that would be that there isn't a way to call it every possible moment. I attempted something similar but unless the mouse was either down or was just clicked about the time of the tick it was called in it didn't work.
Use modloaders OnTickInGame method. make sure you have the code in the load method to set the hook.
ModLoader.setInGameHook(bla bla bla);
Except if you do it at the better constant of 20 times per second, that's only once very 5 milliseconds.That leaves a space in-between where you can click and it won't acknowledge it. Trust me, I've tried.