Answers.Body: <p>Whilst Doug's answer is useful for knowing the ins and outs of a particular event once you've found it, actually finding which events are available in Craft 3 in the current docs is not straight-forward. After a bit of digging, you'll find that most events are part of Craft's <strong>services</strong> - so head to the <a href="https://docs.craftcms.com/api/v3/" rel="nofollow noreferrer">Class Reference</a> and choose the most relevant service from the <code>craft/services</code> menu on the sidebar. The events available to each service are listed at the end of each one. For example:</p>
  <p><a href="https://docs.craftcms.com/api/v3/craft-services-users.html#events" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-services-users.html#events</a>
  <a href="https://docs.craftcms.com/api/v3/craft-services-elements.html#events" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-services-elements.html#events</a>
  <a href="https://docs.craftcms.com/api/v3/craft-services-fields.html#events" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-services-fields.html#events</a>
  <a href="https://docs.craftcms.com/api/v3/craft-services-volumes.html#events" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-services-volumes.html#events</a></p>
  <p>etc etc... (between Craft and Yii there are almost 3000 different events to choose from!).</p>
  <hr />
  <h2>Edit to add...</h2>
  <p>Craft's docs now have a fantastic event code generator tool that helps to narrow down which event you need and provides the scaffolding for calling each one: <a href="https://craftcms.com/docs/3.x/extend/events.html#event-code-generator" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/extend/events.html#event-code-generator</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-16T15:53:48.830Z
Answers.LastActivityDate: 2022-01-05T16:57:40.910Z
Answers.LastEditDate: 2022-01-05T16:57:40.910Z
Answers.UserDisplayName: James Smith
Answers.Body: <p>Here's a list of Event classes and the "Public Properties" that you can get or set:</p>
  
  <p><a href="https://docs.craftcms.com/api/v3/craft-events-assetevent.html" rel="noreferrer">https://docs.craftcms.com/api/v3/craft-events-assetevent.html</a></p>
  
  <h2>An example of getting event data:</h2>
  
  <pre><code>Event::on(
      Users::class,
      Users::EVENT_BEFORE_ACTIVATE_USER,
      function (UserEvent $event) {
          $userElement = $event-&gt;user;
      }
  );
  </code></pre>
  
  <p>Class reference: <a href="https://docs.craftcms.com/api/v3/craft-events-userevent.html" rel="noreferrer">https://docs.craftcms.com/api/v3/craft-events-userevent.html</a></p>
  
  <h2>An example of setting event data:</h2>
  
  <pre><code>Event::on(
      Fields::class,
      Fields::EVENT_REGISTER_FIELD_TYPES,
      function (RegisterComponentTypesEvent $event) {
          $event-&gt;types[] = UserState::class;
      }
  );
  </code></pre>
  
  <p>Class reference: <a href="https://docs.craftcms.com/api/v3/craft-events-registercomponenttypesevent.html" rel="noreferrer">https://docs.craftcms.com/api/v3/craft-events-registercomponenttypesevent.html</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-22T06:03:10.943Z
Answers.LastActivityDate: 2019-02-22T06:03:10.943Z
Answers.UserDisplayName: Doug St. John
Body: <p>I've been looking for an Event Reference doc for Craft 3 just like what we had for Craft 2, but couldn't find one. The only events doc I found for Craft 3 is the plugin updating guide: <a href="https://docs.craftcms.com/v3/extend/updating-plugins.html#events" rel="noreferrer">https://docs.craftcms.com/v3/extend/updating-plugins.html#events</a>.</p>
  
  <p>Did I miss anything? Appreciate if someone can post a link here.</p>
  
  <p>Also, for Craft 2 events, we used to be able to do $event->params[$paramName] to get the params passed into the events, but I struggle to find a way to do similar things in Craft 3. Any suggestions?</p>
  
Tags: <craft3><events>
Title: Events documentation for Craft 3
ThreadText: # Events documentation for Craft 3
  
  (Asked by: username_0 on 2019-02-22)
  
  I've been looking for an Event Reference doc for Craft 3 just like what we had for Craft 2, but couldn't find one. The only events doc I found for Craft 3 is the plugin updating guide: <https://docs.craftcms.com/v3/extend/updating-plugins.html#events>.
  
  Did I miss anything? Appreciate if someone can post a link here.
  
  Also, for Craft 2 events, we used to be able to do $event->params[$paramName] to get the params passed into the events, but I struggle to find a way to do similar things in Craft 3. Any suggestions?
  
  **Tags:** craft3, events
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-02-22. Score: 6 | Accepted answer
  
  Here's a list of Event classes and the "Public Properties" that you can get or set:
  
  <https://docs.craftcms.com/api/v3/craft-events-assetevent.html>
  
  ## An example of getting event data:
  
  ```
  Event::on(
      Users::class,
      Users::EVENT_BEFORE_ACTIVATE_USER,
      function (UserEvent $event) {
          $userElement = $event->user;
      }
  );
  
  ```
  
  Class reference: <https://docs.craftcms.com/api/v3/craft-events-userevent.html>
  
  ## An example of setting event data:
  
  ```
  Event::on(
      Fields::class,
      Fields::EVENT_REGISTER_FIELD_TYPES,
      function (RegisterComponentTypesEvent $event) {
          $event->types[] = UserState::class;
      }
  );
  
  ```
  
  Class reference: <https://docs.craftcms.com/api/v3/craft-events-registercomponenttypesevent.html>
  
  
  ---
  
  ### Answer by username_1 on 2019-10-16. Score: 13
  
  Whilst username_2's answer is useful for knowing the ins and outs of a particular event once you've found it, actually finding which events are available in Craft 3 in the current docs is not straight-forward. After a bit of digging, you'll find that most events are part of Craft's **services** - so head to the [Class Reference](https://docs.craftcms.com/api/v3/) and choose the most relevant service from the `craft/services` menu on the sidebar. The events available to each service are listed at the end of each one. For example:
  
  <https://docs.craftcms.com/api/v3/craft-services-users.html#events>
  <https://docs.craftcms.com/api/v3/craft-services-elements.html#events>
  <https://docs.craftcms.com/api/v3/craft-services-fields.html#events>
  <https://docs.craftcms.com/api/v3/craft-services-volumes.html#events>
  
  etc etc... (between Craft and Yii there are almost 3000 different events to choose from!).
  
  ---
  
  ## Edit to add...
  
  Craft's docs now have a fantastic event code generator tool that helps to narrow down which event you need and provides the scaffolding for calling each one: <https://craftcms.com/docs/3.x/extend/events.html#event-code-generator>
  
  
  ---
  
  