I have a custom entity and I want to set its name through a text box in the GUI. But, so far, I've only succeeded in synchronizing it on the client side. I'm pretty sure I may have to use packets for this one, but I have zero experience in doing that, and can't find any sort of updated guide (the highest one I've found is 1.8x and it wasn't working...). Does anyone know how I could take a custom name inputted in the GUI and send it to the server side entity to save it? Is there any way to do that aside from using packets?
Also it is always good to look at things that exist in Minecraft which are similar. Name tags obviously take in user input on the client and get that information over to the server. So you should look at that code. If you did look at that code, you'd see that name tags use a combination of item stack NBT data (which I believe is automatically synced) with data manager for the entity.
Also it is always good to look at things that exist in Minecraft which are similar. Name tags obviously take in user input on the client and get that information over to the server. So you should look at that code. If you did look at that code, you'd see that name tags use a combination of item stack NBT data (which I believe is automatically synced) with data manager for the entity.
Hello everyone,
I have a custom entity and I want to set its name through a text box in the GUI. But, so far, I've only succeeded in synchronizing it on the client side. I'm pretty sure I may have to use packets for this one, but I have zero experience in doing that, and can't find any sort of updated guide (the highest one I've found is 1.8x and it wasn't working...). Does anyone know how I could take a custom name inputted in the GUI and send it to the server side entity to save it? Is there any way to do that aside from using packets?
Official forge documentation. Look better next time.
Packets would probably be best here.
If you're still having problems, feel free to ask.
Also it is always good to look at things that exist in Minecraft which are similar. Name tags obviously take in user input on the client and get that information over to the server. So you should look at that code. If you did look at that code, you'd see that name tags use a combination of item stack NBT data (which I believe is automatically synced) with data manager for the entity.
If you do decide to use custom packets, then you might find my networking tutorial useful; http://jabelarminecraft.blogspot.com/p/minecraft-forge.html
Thank you so much! This tutorial helped a lot, and I think I've got things working now Thanks!