Rpc is received by client but Cmd is not received by server

Below is a fragment of my code where the Rpc and Cmd are called.
As you can see I check if the player is the client or the server, and depending on which they are I call either an Rpc or a Cmd passing the same parameter.
Debugging this script I can see that the server calls RpcSendRList and the client calls CmdSendRList as desired.

if(networkController.isServer)
{
	networkController.RpcResetRppList();
    foreach(KeyValuePair<int, float> entry in resources)
    {
    	networkController.RpcAddToRppList(entry.Key, entry.Value);
    }
}
else
{
	networkController.CmdResetRppList();
    foreach(KeyValuePair<int, float> entry in resources)
    {
    	networkController.CmdAddToRppList(entry.Key, entry.Value);
    }
}

Below are the Rpcs being called:

[Command]
public void CmdAddToRppList(int _key, float _value)
{
    opponentResources.Add(_key, _value);
}

[ClientRpc]
public void RpcAddToRppList(int _key, float _value)
{
    opponentResources.Add(_key, _value);
}

Debugging this second script only the Rpc is actually called on the client and the Cmd is never called on the server (the breakpoint is never hit).

What am I doing wrong with the commands?

You have to make sure that the Command is happening on the Player object - but you should see a warning for that. It’s probably because you’re not passing an appropriate type through, you should try with a simple type.

Also, in terms of this pattern, it’s worth thinking about who is the server and who is the client. For example, you might be a client, but still running on the server. It might be appropriate depending on your use case for a Cmd to be called whether or not you’re on the server, and then the Cmd does an RPC to update all objects running on clients.

The problem was that the command was not running on the local player. Maybe there should be a warning for if you are trying to send commands from a player that isn’t yours, even though when worded like that it should be obvious.
I also changed it so that the NetworkManager automatically spawns the player prefab. Letting that do its own thing is the easiest way for sure.