Amount (Expression) — Skript
Addon: Skript · Category: Expression · Since: 1.0
Syntax
[the] (amount|number|size) of %objects%Description
The amount of something. Please note that <code>amount of %items%</code> will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the <a href='#ExprItemAmount'>item amount</a> expression.
Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.
<pre> {list::*} Structure<br> ├──── {list::1}: 1<br> ├──── {list::2}: 2<br> │ ├──── {list::2::1}: 3<br> │ │ └──── {list::2::1::1}: 4<br> │ └──── {list::2::2}: 5<br> └──── {list::3}: 6 </pre>
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples
message "There are %number of all players% players online!"