1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

3.5 skript-reflect: Utilities

Discussion in 'skUnity Pages' started by TPGamesNL, Jul 20, 2020.

  1. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,483
    Likes Received:
    93
    Medals:
    Collect
    Syntax:
    Code (Text):
    1. [%objects%]
    2. [%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 (Text):
    1. ...%object%
    Returns the contents of a single array, iterable, iterator, or stream.

    Array value
    Syntax:
    Code (Text):
    1. %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 (Text):
    1. null
    Represents null in Java. This is different from Skript's <none>.

    Bits
    Syntax:
    Code (Text):
    1. [the] (bit %number%|bit(s| range) [from] %number%( to |[ ]-[ ])%number%) of %numbers%
    2. %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 (Text):
    1. [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 (Text):
    1. import:
    2.     ch.njol.skript.lang.Variable
    3.  
    4. effect put %objects% in %objects%:
    5.     parse:
    6.         expr-2 is an instance of Variable # to check if the second argument is a variable
    7.         continue
    8.     trigger:
    9.         set raw expr-2 to expr-1



    Members
    Syntax:
    Code (Text):
    1. [the] (fields|methods|constructors) of %objects%
    2. %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 (Text):
    1. [the] (field|method) names of %objects%
    2. %objects%'[s] (field|method) names
    Returns a list of the fields or methods of an object.

    Is instance
    Syntax:
    Code (Text):
    1. %objects% (is|are) [a[n]] instance[s] of %javatypes%
    2. %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.
     
Loading...