# Events example

```javascript
var module = rise.registerModule("Example", "An example description.")
script.handle("onUnload", function () {
	module.unregister()
})

// Called when you attack an entity
module.handle("onAttack", function(e) {
	return e
})

// Called when you say something in chat
module.handle("onChatInput", function(e) {
	return e
})

// Called when the player clicks
module.handle("onClick", function(e) {
	return e
})

// Called when the player attacks another entity and recieves hit slowdown
module.handle("onHitSlowDown", function(e) {
	return e
})

// Called when you jump
module.handle("onJump", function(e) {
	return e
})

// Called when you press a key
module.handle("onKeyboardInput", function(e) {
	return e
})

// Called a player is killed by you
module.handle("onKill", function(e) {
	return e
})

// Called when movement inputs are accessed
module.handle("onMoveInput", function(e) {
	return e
})

// Called pre motion
module.handle("onPostMotion", function(e) {
	return e
})

// Called pre motion
module.handle("onPreMotion", function(e) {
	return e
})

// Called pre update
module.handle("onPreUpdate", function(e) {
	return e
})

// Called when the 2d ui is drawn
module.handle("onRender2D", function(e) {
	return e
})

// Called when the 3d world is drawn
module.handle("onRender3D", function(e) {
	return e
})

// Called when the player is slowed down by an item
module.handle("onSlowDown", function(e) {
	return e
})

// Called at the start of the clients tick
module.handle("onTick", function(e) {
	return e
})

// Called when the client references inWater method
module.handle("onWater", function(e) {
	return e
})

// Called 20 times per second, just before the players movement is added for the current tick
module.handle("onStrafe", function(e) {
	print("Test") // Prints "Test" to console

	return e
})

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://riseclients-organization.gitbook.io/rise-6-scripting-api/examples/events-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
