Posted January 1, 20241 yr Hey there, super new to minecraft modding and I'm trying to make a few items and most of them depend on the user right clicking the item then if the player is looking at another player or entity in some cases, then something happens. In this case it would open their inventory. If I can just get some help as to what steps I should take to begin this, it would be very appreciated. Thank you
January 1, 20241 yr Sorry, but this forum is a support forum. It's not a learn minecraft modding forum. We answer specific questions *after* you have tried to do things for yourself and got stuck. We do not write or design your mod for you. For your specific questions: * Interacting with entities you didn't create: https://github.com/MinecraftForge/MinecraftForge/blob/fdb22d02cc87d69717462da256696af6f6deb972/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java#L95 * Figuring out what the player is looking at That question has been asked literally hundreds of times before in this forum in its different use cases. You can use the forum's search function. * Opening inventories I suggest you look at the vanilla code for the Villager or wandering trader. Or something else with an inventory, e.g. horses Minecraft menus are not very straight forward for beginners. I suggest you make a simple one to understand how they work, before doing more complicated things: https://docs.minecraftforge.net/en/latest/gui/menus/ Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
January 1, 20241 yr Author Sorry, didn't mean to word it in a way to write the code, just any sources to learn where to find it, I searched a lot and saw stuff like look at the enderman file but couldn't find much there, appreciate the links you sent though and I'll definitely look into the Villagers, hope they'll be helpful. Happy New Year
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.