Skip to content

Commit 12ad04a

Browse files
committed
Custom event update + doc update:
EffCallCustomEvent works async now Extra data has more support Event-values work in the check section
1 parent e35e398 commit 12ad04a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

docs/advanced/custom-syntax/events.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% code-tabs %}
66
{% code-tabs-item title="Syntax" %}
77
```text
8-
[(1¦local)] [custom] event <pattern>:
8+
[local] [custom] event <pattern>:
99
name: # unique name, required
1010
event-values: # list of types, optional
1111
parse:
@@ -21,7 +21,7 @@
2121
{% code-tabs %}
2222
{% code-tabs-item title="Syntax" %}
2323
```text
24-
[(1¦local)] [custom] event:
24+
[local] [custom] event:
2525
patterns:
2626
# patterns, one per line
2727
name: # unique name, required
@@ -90,7 +90,7 @@ If this section is included, you must also [`continue`](./#continue) if you want
9090
{% code-tabs %}
9191
{% code-tabs-item title="Syntax" %}
9292
```text
93-
call custom event %string% [(with|using) [[event-]values] %-objects%] [(with|using) data %-objects%]
93+
call custom event %string% [(with|using) [[event-]values] %-objects%] [[and] [(with|using)] data %-objects%]
9494
```
9595
{% endcode-tabs-item %}
9696
{% endcode-tabs %}
@@ -100,19 +100,19 @@ The first list variable is for [the event-values](#option-event-values), while t
100100

101101
### Extra data
102102

103-
If the event-values aren't enough for your desire, you can make use of the extra data feature. In the event itself, you can get the extra data with the not-yet-created data expression:
103+
If the event-values aren't enough for your desire, you can make use of the extra data feature.
104104
The syntax for adding event-values to a custom event is explained in [the event-values option](#option-event-values), and how to call an event with them is explained in [calling the event](#calling-the-event)
105+
In the event itself, you can get the extra data with the data expression:
105106

106107
{% code-tabs %}
107108
{% code-tabs-item title="Syntax" %}
108109
```text
109-
[extra] [event[-]] data %string%
110+
[extra] [event[-]] data %strings%
110111
```
111112
{% endcode-tabs-item %}
112113
{% endcode-tabs %}
113-
In the syntax above, `%string%` is the index.
114+
In the syntax above, `%strings%` is the index. This doesn't have to be plural, but can be.
114115

115-
{% hint style="danger" %}
116-
This expression doesn't exist yet, until it is created, you can access it like so: `event.getData(%string%)`, where `%string%` is your index.
117-
Why did I already document it if it doesn't exist yet? Because there's a decent chance I'll to do so forgot when I create the expression.
116+
{% hint style="info" %}
117+
It may look fancier to create a custom expression instead of using extra data. To do so, you need to call `event.getData(%index%)` to get the data value.
118118
{% endhint %}

docs/basics/handling-events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You may also listen to multiple events with the same handler. The events do not
2929
```text
3030
import:
3131
org.bukkit.event.entity.ProjectileLaunchEvent
32-
org.bukkit.event.entity.ProjectileHitEvent
32+
org.bukkit.event.entity.ProjectileHitEvent
3333
3434
on ProjectileLaunchEvent and ProjectileHitEvent:
3535
# your code
@@ -53,10 +53,10 @@ skript-mirror exposes an `event` expression, allowing you to access event values
5353
import:
5454
org.bukkit.event.entity.EnderDragonChangePhaseEvent
5555
org.bukkit.entity.EnderDragon$Phase as EnderDragonPhase
56-
56+
5757
on EnderDragonChangePhaseEvent:
58-
if event.getNewPhase() is EnderDragonPhase.CIRCLING!:
59-
event.setNewPhase(EnderDragonPhase.CHARGE_PLAYER!)
58+
if event.getNewPhase() is EnderDragonPhase.CIRCLING:
59+
event.setNewPhase(EnderDragonPhase.CHARGE_PLAYER)
6060
```
6161
{% endcode-tabs-item %}
6262
{% endcode-tabs %}
@@ -74,7 +74,7 @@ The priority level of an event may be set to control when a particular event han
7474
```text
7575
import:
7676
org.bukkit.event.entity.EnderDragonChangePhaseEvent
77-
77+
7878
on EnderDragonChangePhaseEvent with priority highest:
7979
# your code
8080
```

0 commit comments

Comments
 (0)