Sorted List (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.2-dev19, 2.14 (retain indices when looping)

Syntax

sorted %objects%

Description

Sorts given list in natural order. All objects in list must be comparable; if they're not, this expression will return nothing.

Examples

set {_sorted::*} to sorted {_players::*}
command /leaderboard:
	trigger:
		loop reversed sorted {most-kills::*}:
			send "%loop-counter%. %loop-index% with %loop-value% kills" to sender

View source