How to limit number of entries to a given user/user group I have a site where users can add entries of an entry type/section called Listings. 

I would like to limit the number of Listings to a maximum of three per user.

In another CMS I did this by writing a plugin that got triggered when a new Entry was created. This plugin determined the number of existing Entries for a given user and if the maximum was reached, the plugin cancelled the creation of a new entry and instead showed a message that the user had reached their maximum limit of entries.

Not to say that this is the best way to do it, or do it in Craft, but I am new to Craft CMS and have been looking for a hook or event that is triggered when a new entry is created, but I don't seem to be able to find anything like that.

I have also done a fair bit of searching on this topic and cant seem to find any Stack questions or posts on the net....

Any suggestions much appreciated.....
You might want to take a look at this 

Your condition will be 

$author = Craft::$app-&gt;getUsers()-&gt;getIdentity();
$numberOfEntriesByUser = Entry::find()-&gt;sectionId($entry-&gt;getSection()-&gt;id)-&gt;authorId($author-&gt;id)-&gt;count();
if($numberOfEntriesByUser){
    $event-&gt;isValid = false 
} 


You should make sure the author is not an admin or Craft::$app-&gt;getRequest()-&gt;getIsCpRequest() is false otherwise you won't be able to save new entries as well. 

Keep in mind to check for a current user as well. There won't be a user for cronjobs / other public post request