General Script API
  • Overview
  • Introdution
  • Standard
    • Chat
    • Reflection
  • Events
    • Introdution
    • Base Events
    • Player Events
Powered by GitBook
On this page
  1. Standard

Reflection

This is an unsafe API feature and require permissions in configuration:

allow-reflect

allow-bukkit-reflect (For only org.bukkit.*)

allow-nms-reflect (For only net.minecraft.*)

Allows access to classes not included in API

Reflection.findClass(String)

Find a class in current server

Operation will be recorded if configuration logging.log-reflection-access is true

If returns a java.lang.Class instance, you can use it with standard java reflection

arg (String) className Name of target class

return (java.lang.Class|undefined) If class found, returns an instance of java.lang.Class, returns null when ClassNotFoundException catched

throws java.lang.IllegalStateException When reference this method without permission

throws java.lang.IllegalStateException When reference this method with non-NMS package name without allow-nms-reflect permission

throws java.lang.NullPointerException When reference this method with non-bukkit package name without allow-bukkit-reflect permission

PreviousChatNextIntrodution

Last updated 1 year ago