Jump to content

Trying to make an Inventory Reader Item


SwimmingTuna

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.