ModAPI.hooks is the global generated by actual code. It has quite a few propeties, but most of them are just foundations for more user friendly parts of the ModAPI, so I won’t explain them.
ModAPI.hooks.methods
is a String-to-method dictionary/object of every java method. This allows you to do pretty much whatever you want in terms of modifying and hooking into code.
ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("com.package.abc.MyClass", "myMethod")] = function () {}
var myMethodName = ModAPI.util.getMethodFromPackage("com.package.abc.MyClass", "myMethod");
const originalMethod = ModAPI.hooks.methods[myMethodName];
ModAPI.hooks.methods[myMethodName] = function (...args) {
//args is the array of arguments passed in.
//on an instance method, this first (args[0]) will almost always
//be $this, ie: the object the method is being run on
return originalMethod.apply(this, args);
}
ModAPI.hooks._teavm
is usually only used for internal purposes, but it is basically a collection of every internal TeaVM method. Keep in mind that this only stores references (for performance reasons), so modifying and editing it’s contents will not affect the way the game runs.