You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+25-9Lines changed: 25 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -220,24 +220,40 @@ class SettingsGUI: UndefinedMenu("Settings") {
220
220
```
221
221
222
222
## Events
223
-
When using this api for events you **won't** need to register any events or even extend the Listener Class. The only thing you will need to do to make events work is create a method with the `@EventHandler` and the event type as the first parameter. (See below)
224
223
224
+
> [!CAUTION]
225
+
> KOTLIN ONLY
226
+
227
+
When using this API you won't need to do and registering of event or even extending the `Listener` class. Even creating custom events is easier.
228
+
229
+
### Listening
230
+
Listening to an event is straight forward and easy. You need to create a method called `event<EventType>`. (See below)
225
231
226
-
### Kotlin
227
232
228
233
```kotlin
229
-
@EventHandler
230
-
funonJoin(e:PlayerJoinEvent){
231
-
//Code
234
+
event<PlayerJoinEvent> {
235
+
//Player Join
232
236
}
233
237
```
234
238
235
-
### Java
239
+
To be able to unregister the listener you can very easily put `.unregister` at the end. (See below)
240
+
241
+
```kotlin
242
+
event<PlayerJoinEvent> {
243
+
//Player Join
244
+
}.unregister()
245
+
```
246
+
247
+
### Custom Event
248
+
Creating a custom event using this API you extend the `UndefinedEvent` class (See below)
0 commit comments