3.5 skript-reflect: Utilities

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

TPGamesNL

Staff member
Moderator
Supporter
Addon Developer
Dev Programme
Jan 20, 2018
1,501
108
63
21
Collect
Syntax:
Code:
[%objects%]
[%objects% as %javatype%]

Creates an array containing the specified objects. Specifying a type determines the component type of the resulting array.

The brackets in this syntax are literal, not representing an optional group.



Spread
Syntax:
Code:
...%object%

Returns the contents of a single array, iterable, iterator, or stream.

Array value
Syntax:
Code:
%array%[%integer%]

Represents the value at a certain index of an array.

This value may be read from and written to.

The brackets in this syntax are literal, not representing an optional group.



Null
Syntax:
Code:
null
Represents null in Java. This is different from Skript's <none>.

Bits
Syntax:
Code:
[the] (bit %number%|bit(s| range) [from] %number%( to |[ ]-[ ])%number%) of %numbers%
%numbers%'[s] (bit %number%|1¦bit(s| range) [from] %number%( to |[ ]-[ ])%number%)

Represents a subset of bits from a number.

This value may be read from and written to.

Raw expression
Syntax:
Code:
[the] raw %objects%

Returns the underlying object of an expression.

When used with the expression-expression, you can set it to a value, which will change the input value from that argument. This can be used to store data in variables in the calling trigger.

Code:
import:
    ch.njol.skript.lang.Variable

effect put %objects% in %objects%:
    parse:
        expr-2 is an instance of Variable # to check if the second argument is a variable
        continue
    trigger:
        set raw expr-2 to expr-1



Members
Syntax:
Code:
[the] (fields|methods|constructors) of %objects%
%objects%'[s] (fields|methods|constructors)

Returns a list of the fields, methods, or constructors of an object, including their modifiers and parameters.

If you need a list of field or method names without modifier or parameter details, see Member Names.

Member names
Syntax:
Code:
[the] (field|method) names of %objects%
%objects%'[s] (field|method) names

Returns a list of the fields or methods of an object.

Is instance
Syntax:
Code:
%objects% (is|are) [a[n]] instance[s] of %javatypes%
%objects% (is not|isn't|are not|aren't) [a[n]] instance[s] of %javatypes%

Checks whether objects are instances of the given java types.
 
  • Like
Reactions: Pierrelasse