Do something on save of an entry if that entry is in a particular section, then I want to do some task.

I can't really find the event docs I need to do that. Everything I've come across has been for Craft 2.

Any steps for a hint?
Craft::$app-&gt;elements-&gt;on(Elements::EVENT_BEFORE_SAVE_ELEMENT, function(ElementEvent $e) {

    // Make sure it's an entry.
    if ($event-&gt;element instanceof \craft\elements\Entry) {
        $entry = $event-&gt;element;

        // Check if it's in the section you care about
        if ($entry-&gt;sectionId == 1) {
            // Do your custom logic
        }
    }
});