removeAfter

fun Entity.removeAfter(plugin: Plugin, duration: Duration): TaskHandle

Automatically removes this entity after the specified duration.