Started by
Kemuri Senpai
on
Topic category: Help with Minecraft modding (Java Edition)
I would like to make a player eat food that he is holding in the main hand by pressing the 'X'-button, the same if I would hold my right mouse-button, but it should happen if I press it once and no need to hold it while eating; It also has to be the original game event for eating, because I would like to use this on vanilla server, so it has to send the event to the host;
can someone help, I am still very new to coding and modding in minecraft?
i dont think thats possible. it might be but i have no idea. the only solution i have is replace the right click keybind in minecraft with x
FireDemon, thanks for your reply; in the web you can find some information about the package "net.minecraft.src" which also contains "PlayerController"; this class is able to perform actions as a player, for example place blocks, turn around or attack some entity; the problem is, the package has been split through the time and now I could never find the class "PlayerController" to use it; I just don't know whether it has another name or it has been moved to other package or maybe has been deleted; so I think, it's possible, but to hard to find
Or you could do something like this;
I actually don't know if that code will work (never tested or used a method like this). But I'm sure it does.
Wait no this is the 3000 post!
Wait no idk anymore