Appendix A. ScriptCraft Variables

In this appendix, I’ll cover the variables provided by ScriptCraft.

The server Variable

The server variable is a global variable provided by ScriptCraft. It refers to the net.canarymod.api.Server object, which is a Java object representing the Minecraft server. Refer to https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/Server.html for full details of all the methods available for this object.

The __plugin Variable

This global variable is a reference to the ScriptCraft plugin. Some CanaryMod API methods require an net.canarymod.plugin.Plugin object as a parameter. If you need to call such methods from JavaScript, you should provide the __plugin variable where an object of type net.canarymod.plugin.Plugin ...

Get A Beginner’s Guide to Writing Minecraft Plugins in JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.