skript-reflect
2.x
2.x
  • skript-reflect
  • Getting Started
  • Basics
    • Reading Javadocs
    • Importing classes
    • Running Java code
    • Handling events
    • Utilities
  • Advanced
    • Error handling
    • Loading external libraries
    • Custom syntax
      • Effects
      • Conditions
      • Expressions
      • Events
    • Computed Options
    • Reflection
      • Proxies
      • Sections
    • Experiments
  • Code Conventions
  • Frequently Asked Questions
Powered by GitBook
On this page
  • Collect
  • Spread
  • Array Creation
  • Array Value
  • Null
  • Bits
  • Raw Expression
  • Members
  • Member Names
  • Is Instance
  • Class reference
  • Plugin instance

Was this helpful?

  1. Basics

Utilities

Collect

[%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

...%object%

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

Array Creation

new %javatype%[%integer%]

Creates an array of the given type and size. The type may be primitive, which doesn't require an import.

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

Array Value

%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

null

Represents null in Java. This is different from Skript's <none>.

Bits

[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

[the] raw %objects%

Returns the underlying object of an expression.

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

[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.

Member Names

[the] (field|method) names of %objects%
%objects%'[s] (field|method) names

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

Is Instance

%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.

Class reference

%javatype%.class

Returns a reference to the class from the given java type. Returns an object of type java.lang.Class. This expression also supports primitive types, which doesn't require an import.

Plugin instance

[(an|the)] instance of [the] plugin %javatype/string%

Returns the instance of the given plugin (either the name as a string, or the plugin class).

PreviousHandling eventsNextAdvanced

Last updated 3 years ago

Was this helpful?

When used with , 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.

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

Member Names
the expression-expression