You are browsing as a guest. Sign up (or log in) to start making projects!

2h 51m 46s logged

The Mod Is Actually Done Now

What the Issue Was

For some reason the mod worked fine for a couple of days, it had no problem with beta testing and stuff.

When I handed it to the requester, he claimed that the item names weren’t staying( persistent ).

e.g. he renamed the Name Tag to be say wolfy, It would show up as wolfy for a second until he interacted with it.

Which is weird since when I tested it , it was working perfectly fine.

So created a new instance of Minecraft and did the testing again , this time even I was getting the issue.

in my old instance the mod worked fine and even in IntelliJ’s runClient instance it worked fine.
This issue was getting annoying as well now.


So What was the issue

The worst kind of issue, the cause was that if you renamed the item during the starting of a tick then it would work just fine( no clue , why).

1/20th of second is called a tick.

But if it during the tick , the server won’t sync with the changes and this would create a ghost item , that exist in client only.

now why did the dev tool kit not show this error:
this is due to low performance of dev kit due to high ram.


How Did I Actually Fix This

before the tick Minecraft was doing this sync between client and server dynamically for my item ( there was no sync logic ).

The fix was to delve into networking and create a packet that had my custom payload , now the server would read this payload every time it receives it , not just at the start of the tick.

This solved the issue pretty quickly.

The majority of time I spent on this issue was figuring out the reason behind it

0
1

Comments 0

No comments yet. Be the first!