# IJobChunk

> IJobChunk is a type of [IJob] that iterates over a set of chunks. For each chunk the job runs on, the job code receives an ArchetypeChunk instance representing the full [chunk], plus a bitmask indicating which entities in the chunk should be processed.

## Definition

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

```csharp
[JobProducerType(typeof(JobChunkExtensions.JobChunkProducer<>))]
public interface IJobChunk
```

## Remarks

Schedule or run an IJobChunk job inside the [SystemBase.OnUpdate](/engine/7000.0/script-reference/unity/entities/systembase/onupdate.md) function of a [SystemBase](/engine/7000.0/script-reference/unity/entities/systembase.md) implementation. When the system schedules or runs an IJobChunk job, it uses the specified [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) to select a set of [chunks]. The entities in each chunk are examined to determine which have the necessary components enabled, according to the [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) provided at schedule time. The job struct's `Execute` function is called for each chunk, along with a bitmask indicating which entities in the chunk should be processed.

To pass data to your Execute function (beyond the `Execute` parameters), add public fields to the IJobChunk struct declaration and set those fields immediately before scheduling the job. You must always pass the component type information for any components that the job reads or writes using a field of type, [ComponentTypeHandle\<T>](/engine/7000.0/script-reference/unity/entities/componenttypehandle1.md). Get this type information by calling the appropriate [ComponentSystemBase.GetComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getcomponenttypehandle.md) function for the type of component.

[chunks]: xref:concepts-archetypes#archetype-chunks

Additional Resources: [JobChunkExtensions](/engine/7000.0/script-reference/unity/entities/jobchunkextensions.md), [IJobEntity](/engine/7000.0/script-reference/unity/entities/ijobentity.md)
