---
title: "equipment(of:forEntity:)"
framework: tabletopkit
role: symbol
role_heading: Instance Method
path: "tabletopkit/tabletopgame/equipment(of:forentity:)"
---

# equipment(of:forEntity:)

Retrieves the specified equipment type associated with an entity if it exists.

## Declaration

```swift
func equipment<E>(of type: E.Type, forEntity entity: Entity) -> E? where E : EntityEquipment
```

## Parameters

- `type`: The type of equipment to retrieve.
- `entity`: The entity that’s associated with the equipment type you want to find.

## Return Value

Return Value The equipment associated with the entity if it exists; otherwise, nil.

## Discussion

Discussion You can use this method to create custom interactions.

## See Also

### Adding equipment to the game

- [equipment](tabletopkit/tabletopgame/equipment.md)
- [equipmentIDs](tabletopkit/tabletopgame/equipmentids.md)
- [equipment(matching:)](tabletopkit/tabletopgame/equipment(matching:).md)
- [equipment(of:)](tabletopkit/tabletopgame/equipment(of:).md)
- [equipment(of:matching:)](tabletopkit/tabletopgame/equipment(of:matching:).md)
