Here's your tutorial for networking, since nobody linked it before: https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
Honestly. Packets are very important and you should learn it at some point or another. With a lot of capabilities it's hard to get the client updated, My sollution was to send all capability updates in a synchronisation packet when the player logs in.
Here's an example that I'm currently using to send capability info to the client:
public class SmallMessage implements IMessage {
public SmallMessage(){}
private NBTTagCompound toSend;
public SmallMessage(NBTTagCompound tag){
this.toSend = tag;
}
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeTag(buf, this.toSend);
}
@Override
public void fromBytes(ByteBuf buf) {
this.toSend = ByteBufUtils.readTag(buf);
}
public static class MessageHandler implements IMessageHandler<SmallMessage, IMessage> {
@Override
public IMessage onMessage(final SmallMessage content, final MessageContext ctx) {
FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(new Runnable(){
@Override
public void run(){
final IBarHandler handler = Minecraft.getMinecraft().thePlayer.getCapability(CAPABILITY_BAR, null);
NBTTagCompound tag = content.toSend;
handler.setMana(tag.getInteger("mana"));
handler.setHealth(tag.getInteger("health"));
handler.setFatigue(tag.getInteger("fatigue"));
}
});
return null;
}
}
}
and I call it using
if(player.hasCapability(CAPABILITY_BAR, null)) {
final IBarHandler instance = getHandler(player);
final NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("mana", instance.getMana());
tag.setInteger("health", instance.getHealth());
tag.setInteger("fatigue", instance.getFatigue());
Main.packetHandler.barWrapper.sendTo(new SmallMessage(tag), (EntityPlayerMP) player);
}
Obviously you could easily add whatever information to the NBTTagCompound or even work with TagLists and such. The rest of the code is initiated in the way you see in the documentations linked above. If you read it through thoroughly you should be able to get a packet working.