How do I replicate an inventory?

Well you should spawn the Item in world (create a instance of it) and then store it in the array.
Using a Server RPC to add the item server side, and have it replicated to client.

Now in my opinion having a inventory with references to actors for a networked game.
Is not something i see as a generally good idea, if you think about having a lot of players.
And all of them are carrying a bunch of items, that are referenced and must be located some where in the world but hidden or something as they are in a backpack or what have you.

A struct with a item id defining the type of item and filling in the data as needed.
e.g: Icons for UI using the ID.

Also have a look at conditonal replication, for my players inventory my condition is to Owner only like this.


// replicating this ONLY to owning player.
DOREPLIFETIME_CONDITION(AMyPlayerClass, InventoryContainer, COND_OwnerOnly);

This will save you a lot of badwidth.

Now am not saying its the only way to do it and depending on your game design so 4th but this is preferred approach by many.