# Sandbox.BaseInventoryComponent.Switch

```csharp
void Switch(BaseInventoryItem item, bool allowHolster = False)
```

Makes the given item active, holstering whatever was active. Pass null with
`allowHolster` to holster everything. Routed through the host.

### Parameters

- `item` (`BaseInventoryItem`)
- `allowHolster` (`bool`), default `False`

Declared in [Sandbox.BaseInventoryComponent](/api/Sandbox.BaseInventoryComponent).
Assembly: `Sandbox.Engine`.
