Skip to main content
Prefer high-level APIs first. Direct Java calls are advanced and can be version-sensitive.

Java

Reflect

Reflect works with raw Java objects and class objects. It is useful for external libraries, Minecraft objects that are not yet wrapped by the script API, and small compatibility scripts. For Minecraft classes, fields, and methods, use Mojang names. Selvut maps them to the runtime names automatically for Java.type(...), Reflect.classByName(...), field lookups, and method invocation.
Reflect returns primitive values directly. Object and class results stay raw so they can be passed back into other Reflect calls. Raw calls are not automatically marshalled to the client thread. Raw Minecraft objects returned by entity/item/packet helpers are intentionally outside the stable scripting API.