Remote Interface

This mod provides a remote interface for modders to access its functionalities for making mod testing to be much easier than before. Modders can also use it to control the behaviors of certain cheats when applied on items or entities on their mods.

Dependency
Before accessing the events and functions in the remote interface, you will have to make sure Creative Mode is loaded before your mod by adding dependency to it in info.json. Optional dependency is recommended so that users of your mod can choose whether they want Creative Mode or not: "dependencies": ["? creative-mode >= 0.2.3"] According to the events and functions you need, the required version of Creative Mode may be different. It is recommended to keep it the most updated version.

Interface
The name of interface is, so, for example, to use its functions, you use: remote.call("creative-mode", ...) In addition, you can also use the following snippet to check whether Creative Mode has been installed correctly: if remote.interfaces["creative-mode"] then -- It is safe to use its events and functions. end

Events
Events are used to notify your mods that something in Creative Mode has happened. Your mod can register a callback for a given event by using the combination of LuaBootstrap::on_event and LuaRemote::call, where the later function returns the ID of the desired event and the former one registers your callback for the event. See the following examples for details.

Functions
Functions can be used to access the current status of Creative Mode as well as access the other functionalities like cheats and modding UI. There are more functions other than the following list, but those unlisted ones are not designed to be used by modders. They are designed to be used as commands or for examples.