Event (Structure) — Skript

Addon: Skript · Category: Structure · Since: 1.0, 2.6 (per-event priority), 2.9 (listening to cancellable events)

Syntax

[on] [uncancelled|cancelled|(any|all)] <.+> [with priority (lowest|low|normal|high|highest|monitor)]

Description

The structure used for listening to events.

Optionally allows specifying whether to listen to events that have been cancelled, and allows specifying with which priority to listen to events. Events are called in the following order of priorities.

``` lowest -> low -> normal -> high -> highest -> monitor ```

Modifying event-values or cancelling events is not supported when using the 'monitor' priority. It should only be used for monitoring the outcome of an event.

Examples

on load:
	broadcast "loading!"
on join:
	if {first-join::%player's uuid%} is not set:
		set {first-join::%player's uuid%} to now
cancelled block break:
	send "<red>You can't break that here" to player
on join with priority lowest:
	# called first

on join:
	# called second

on join with priority highest:
	# called last

View source