ClientRpc cannot access Despawn on the server

[ServerRpc]
    public void TearClothServerRpc(NetworkObjectReference itemReference)
    {
        if (!IsHost && !IsServer) return;

        if (itemReference.TryGet(out var itemObject))
        {
            ItemManager itemManager = ManagerObject.Instance.GetManager(ManagerType.ItemManager) as ItemManager;
            Item cloth = itemObject.GetComponent<Item>();

            Item item = itemManager.SpawnItem(itemManager.FindItemByName("Other Item"), _playerInventory.transform.position);

            // item.gameObject.SetActive(false)
            item.isPickedUp = _playerInventory.CanStoreItem(item);
            // item.gameObject.SetActive(!item.isPickedUp);
            print(item.isPickedUp);
            if (!item.isPickedUp)
            {
                HandleDrop(item, _playerInventory.transform.position + Vector3.up);
            }

            TearClothClientRpc(itemReference, item.NetworkObject, item.isPickedUp);
            // cloth.NetworkObject.Despawn(false);
        }
    }
    [ClientRpc]
    public void TearClothClientRpc(NetworkObjectReference itemReference,
    NetworkObjectReference newItemReference, bool canPickup)
    {
        if (itemReference.TryGet(out var itemObject) && newItemReference.TryGet(out var newItemObject))
        {
            Item cloth = itemObject.GetComponent<Item>();
            Item newItem = newItemObject.GetComponent<Item>();

            cloth.ParentContainer.Remove(cloth);
            // Destroy(cloth.gameObject);
            newItem.gameObject.SetActive(!canPickup);

            if (canPickup)
            {
                _playerInventory.Pickup(newItem);
            }
        }
    }

When Despawn is done on ServerRpc to use and remove the item, ClientRpc cannot access the item’s data.

I don’t think it’s a good way to use Invoke or Coroutine. Is there a good way?

What exactly is the “item’s data”? The item itself? If the item object contains data, then I’m not seeing it here. There’s also no Invoke or Coroutine shown.

Sending a NetworkObjectReference does nothing but to send the NetworkObject’s ulong network ID, it does not transfer any data contained within the game object or its components.

The information you want is in the Item script (ParentContainer = which container is it in) You need to remove it using that item. However, if you do Despawn on ServerRpc, it is not available on ClientRpc. itemReference.TryGet (out variable object)