Educationalmoose
-
Posts
2 -
Joined
-
Last visited
Posts posted by Educationalmoose
-
-
I just started modding a few weeks ago and I am new to forge but have at least a basic understanding of Java programming. I am self taught but know the basics and am constantly trying to improve. Anyways, I wanted to learn how to use containers, inventories, etc. and I noticed a lack of information newer than 1.14 and was having a lot of difficulty following tutorials online. For this specific mod, I was trying to start off super basic and just make an inventory with 2 slots, but I wanted to put the inventory on an entity that already exists within minecraft, because I thought it would be easier than creating my own entity. I decided to use the pig, and so far I have been basing almost all of my code off of the horse entity. I have come across many problems though and I do not know where to find an answer since there is not much documentation on this. I have been learning a lot about tileEntities and I was going to try making a chest with 2 inventory slots and then just opening that chest whenever I click on a pig, but this seems like an inefficient way to go about doing this. Unfortunately since I am new to modding I do not know all of the different possible ways to accomplish this and I was wondering if someone could help me a little bit so I can get on my way. I will supply people with any code that they might need to see to help me out, and I am using IntelliJ. Thanks!
[1.16.3] Giving an entity an inventory
in ForgeGradle
Posted
Thanks for the link! I do not know if I had the right approach to implementing this idea, but so far I copied the AbstractChestedHorseEntity.java script and started to replace a lot of keywords with their PigEntity equivalent. I also copied a script for the container of the PigEntity and the screen of the PigEntity. Below will be the code:
Sorry if this was long, I'm also new to the website so if there is a better way to format this that is easier to read just let me know. The main problem I have right now is when I try to register the container, I followed a 1.15 tutorial for registering a container and it does not seem to be compatible with the PigInventoryContainer script because PigEntity cant be accessed