# Capsule
> Represents a capsule location with an optional assigned player.
`gg.lode.observerapi.api`
---
## Signature
```java
public record Capsule(Location location, @Nullable Player player)
```
---
## Methods
### location
```java
public Location location()
```
**Returns:** `Location` - the capsule's location
---
### player
```java
public @Nullable Player player()
```
**Returns:** `@Nullable Player` - the player assigned to this capsule, or `null` if unoccupied
---
### hasPlayer
```java
public boolean hasPlayer()
```
**Returns:** `boolean` - `true` if a player is assigned to this capsule
---
### setPlayer
```java
public void setPlayer(Player player)
```
Assigns a player to this capsule.
| Parameter | Type | Description |
|-----------|------|-------------|
| `player` | `Player` | The player to assign |
---
## Related Pages
- [[CapsuleType]]
- [[ICapsuleManager]]
- [[PlayerAssignedToCapsuleEvent]]
- [[PlayerSwapCapsulesEvent]]