I wondered if there were a simple check if the area type passed to the callback function _on_area_entered(area) has the die() function and discovered after a fair bit if searching this works:
func _on_area_entered(area):
queue_free()
if (area.has_method("die")):
area.die()
However, in another post it’s mentioned that the layers approach is probably more efficient so only posting this out of interest. There are often numerous ways of achieving the same goal.
The above code works but has a drawback that there could be other nodes of the same type added later on with a die() method and we might not want their die() methods triggered.