GThoro Posted February 23, 2021 Posted February 23, 2021 Hello, I've attached some capabilities to players on server side, but I need that data to display in GUI. I know I'm supposed to sync it to client but it's a bit vague. Can someone give me few pointers or examples? I'm able to put all needed data in extraDataWriter while using NetworkHooks.openGui but I need to write another serializer/deserializer for capability data. Does syncing capability data allows me to skip that? Also in the same GUI I need some config values that are set server-side, how can I access that? Is there a way to sync configs, or I need to use extraDataWriter for this? Quote
GThoro Posted February 23, 2021 Author Posted February 23, 2021 1 hour ago, diesieben07 said: No. "Syncing" describes exactly this process of sending some kind of network packet (that is what NetworkHooks.openGui does under the hood) containing the capability data. I see, I thought there is some magic way to call player.getCapability() on client side and get the same results as on server side. Thanks, I know what to do now. Quote
GThoro Posted February 23, 2021 Author Posted February 23, 2021 One more thing if I may ask. If I need to perfrom some action on that server side capabilities depending on user interaction in GUI, I need to send packet with message from client to server? Quote
Recommended Posts
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.