Posted July 3, 20241 yr I want to say that I am a newbie and a simpleton in modding. I've been working on this for a long time, but I can't find a solution. The point is, I've created an NPC that has an anvil function. However, I can't move items in the inventory while in the anvil menu. They just go back to where I took them from. And when I click on empty inventory slots, items randomly move around the inventory and sometimes get duplicated. As far as I understand, this is related to synchronization between the client and server. I can't get this synchronization to work properly. Although I managed to do it for other functions. I encountered a similar problem when I wanted to implement trading with villagers in the same way. But back then, I ended up creating the trading function from scratch, as I couldn't solve the desynchronization issue. If you have an idea why synchronization is not working, advice or a possible solution to the problem, I will be very grateful to you. My Code: Spoiler TheAnvil.java - GUI of the anvil that opens when you press a special button. https://drive.google.com/file/d/1rHwCqS_heow5uBHkD8CqvOwEpl60fZKS/view?usp=sharing ContainerAnvil.java - This module should synchronize the states between the client and the server. https://drive.google.com/file/d/1tSyktS36G2MdzWX8IBdeRIbXxou0cMY7/view?usp=sharing
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.