Jump to content

KoloBear

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by KoloBear

  1. Definitely sounds like you're not registering things on the right sides. Here is a reference: https://docs.minecraftforge.net/en/1.19.2/concepts/sides/
  2. That makes a whole lot of sense, thanks for the detailed explanation! I ended up getting data to pass from the entity to the screen via the menuprovider, however its not like what you described. I'm going to try it on a server and see what happens. Essentially when I make a new menuprovider I have it saved to another menuprovider object before i return it example: EntityClass: public static myCustomMenu ref; public getEntity(){ return this; } public myCustomMenu createMenu(int windowId, Inventory playerInventory, Player playerEntity) { ref = new myCustomMenu(windowId, playerInventory, null); ref.setEntity(getEntity()); //reference whats in the menu here return ref; } So the screen really only reads variables from the menu class, which is created by client or server and talks to the entity? And you can't access the screen because its under a registry? I think I'm starting to get it, thanks for the help agian!
  3. It looks like I can actually save the MenuProvider before returning it as an object.. I feel like i'm so close, haha. I was also thinking about using nbt data, but if i can get this to work then i guess theres no need. Which actually brings up a better question, what is nbt data good for when creating mods? Just like unusual item/entity states?
  4. Hello everyone! I'm new to the forum as I've just picked up modding agian. I use to do it way back when but really could only add blocks and other simple things. I have some questions about forge for current problems I'm having as well as somethings I know I'll run into. Firstly, I would really like to learn so I wont be posting any code. I've read through the forge docs about menus and screens, but I still don't really understand even though I've got one working. Whats the difference between a screen/menu/container? What are some methods of referencing variables from the screen class to the entity that called it (or really any other static object) It looks like when the screen is registered (MenuScreens.register(xxxx)) there is a disconnect to that object. I've read things on data packets and whatnot, but I still don't really see how you could use that without finding the actual screen object during runtime. Also, I tried looking in the horseinventoryscreen. I found that it passes an abstractHorse through their register somehow, yet that horseregistry is not in the regular MenuType registries. Is there a custom registry just for special cases like that? I can only seem to find the MenuScreens for just about everything else. Any advice/thoughts would be appreciated!
×
×
  • Create New...

Important Information

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