Queue Start/End (Experimental) (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.10 (experimental)

Syntax

[the] (start|end) of %queue%

Description

Requires the <code>using queues</code> experimental feature flag to be enabled.

The first or last element in a queue. Asking for this does <b>not</b> remove the element from the queue.

This is designed for use with the <code>add</code> changer: to add or remove elements from the start or the end of the queue.

Examples

set {queue} to a new queue
add "hello" to {queue}
add "foo" to the start of {queue}
broadcast the first element of {queue} # foo
broadcast the first element of {queue} # hello
# queue is now empty

View source