# GetChunkComponentData

> Gets the value of a chunk component.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## GetChunkComponentData\<T>(ArchetypeChunk)

Gets the value of a chunk component.

```csharp
public T GetChunkComponentData<T>(ArchetypeChunk chunk) where T : unmanaged, IComponentData
```

### Parameters

**** (\[ArchetypeChunk]\(/engine/7000.0/script-reference/unity/entities/archetypechunk)): The chunk.

### Returns

| Type | Description                                        |
| ---- | -------------------------------------------------- |
| T    | A struct of type T containing the component value. |

### Remarks

A chunk component is common to all entities in a chunk. You can access a chunk [IComponentData](/engine/7000.0/script-reference/unity/entities/icomponentdata.md) instance through either the chunk itself or through an entity stored in that chunk.

## GetChunkComponentData\<T>(Entity)

Gets the value of chunk component for the chunk containing the specified entity.

```csharp
public T GetChunkComponentData<T>(Entity entity) where T : unmanaged, IComponentData
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.

### Returns

| Type | Description                                        |
| ---- | -------------------------------------------------- |
| T    | A struct of type T containing the component value. |

### Remarks

A chunk component is common to all entities in a chunk. You can access a chunk [IComponentData](/engine/7000.0/script-reference/unity/entities/icomponentdata.md) instance through either the chunk itself or through an entity stored in that chunk.
