Posted September 26, 20196 yr I'm trying to Sync up a server-side player capability with a client-side player capability. I don't know what I should send the packet to. I tried the player but I don't know exactly how to use the "sendTo" method. I tried: MerchantcraftPacketHandler.channel.sendTo(new SyncBalancePacketToClient(b), ???, NetworkDirection.PLAY_TO_CLIENT); I have no idea how to work with NetworkManager (the second parameter), and I'm not even sure about "NetworkDirection.PLAY_TO_CLIENT".
September 26, 20196 yr Author I think I figured it out: player.connection.netManager is the second parameter.
September 26, 20196 yr Author 11 hours ago, diesieben07 said: You should use send and PacketDistributor. Example:channel.send(PacketDistributor.PLAYER.with(yourTargetPlayer), msg). There are more distributors available that allow you to e.g. send to a whole dimension. If it's not to much trouble, could you or anyone who knows explain why this would be the preferred way to send such a packet?
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.