# Loop tasks

If you want to execute lopping tasks just extend your created class to `com.xg7plugins.tasks.tasks.TimerTask`&#x20;

```java
package org.example;

import com.xg7plugins.tasks.tasks.TimerTask;

public class ExampleRepeatingTask extends TimerTask {
    //Define the plguin configurations
    public ExampleRepeatingTask() {
        super(
                plugin,
                id,
                delay,
                period,
                state,
                string: executor name or boolean: isABukkitTaskAsync
        );
    }

    @Override
    public void run() {
        // Code to be executed periodically
    }
}

```

Then, register you task in getTimerTasks() method on Main class

```java
 @Override
public List<TimerTask> getTimerTasks() {
  List<TimerTask> tasks = new ArrayList<>();
   tasks.add(new ExampleRepeatingTask());
   return tasks;
 }
```

Done!
