25 lines
741 B
Markdown
25 lines
741 B
Markdown
|
# Use An Event
|
||
|
|
||
|
## Example
|
||
|
```javascript
|
||
|
import { Events } from 'minecraft';
|
||
|
|
||
|
Events.WORLD_TICK.addListener(e => {
|
||
|
// Use e.getWorld()
|
||
|
});
|
||
|
```
|
||
|
|
||
|
## All Events
|
||
|
| Name | Description | Input Type | Output Type |
|
||
|
| --- | --- | --- | --- |
|
||
|
| ```WORLD_TICK``` | Triggered on every world tick. | ```WorldEvent``` | None |
|
||
|
| ```ATTACK_BLOCK``` | Triggered when breaking a block. | ```BlockEvent``` | ```ActionResult``` |
|
||
|
| ```USE_BLOCK``` | Triggered when using a block. | ```BlockEvent``` | ```ActionResult``` |
|
||
|
| ```USE_ITEM``` | Triggered when using an item. | ```ItemEvent``` | ```ActionResult``` |
|
||
|
|
||
|
## Manually Trigger An Event
|
||
|
```javascript
|
||
|
import { Events } from 'minecraft';
|
||
|
|
||
|
const result = Events.<Event Name>.trigger(<Input Value>);
|
||
|
```
|