Faucet Mod SDK 1.0.0
Modding API for Minecraft Legacy Console Edition
Loading...
Searching...
No Matches
IMod Class Referenceabstract

Interface every mod DLL must implement. More...

#include <IMod.h>

Public Member Functions

virtual const ModInfoGetInfo () const =0
 Return static metadata. Pointer must stay valid forever.
virtual bool OnLoad ()=0
 First call. Set up hooks, register commands here. Do NOT call game APIs (Level, Player, etc.) — use OnInit() for that.
virtual bool OnInit ()=0
 Called after Minecraft and MinecraftServer finish initializing. Safe to call Minecraft::GetInstance(), MinecraftServer::getInstance(), etc.
virtual bool OnUpdate (float deltaTime)=0
 Called every game tick (~20 times per second).
virtual void OnShutdown ()=0
 Called on shutdown. Unregister commands/events, free resources.

Detailed Description

Interface every mod DLL must implement.

Lifecycle order:

Step Call When
1 CreateMod() DLL loaded — factory function
2 GetInfo() Immediately after creation
3 OnLoad() All mods loaded, before server/client init
4 OnInit() After Minecraft and MinecraftServer are up
5 OnUpdate() Every game tick (20/sec)
6 OnShutdown() On exit

Definition at line 62 of file IMod.h.

Member Function Documentation

◆ OnInit()

virtual bool IMod::OnInit ( )
pure virtual

Called after Minecraft and MinecraftServer finish initializing. Safe to call Minecraft::GetInstance(), MinecraftServer::getInstance(), etc.

Returns
false to abort this mod.

◆ OnLoad()

virtual bool IMod::OnLoad ( )
pure virtual

First call. Set up hooks, register commands here. Do NOT call game APIs (Level, Player, etc.) — use OnInit() for that.

Returns
false to abort this mod.

◆ OnUpdate()

virtual bool IMod::OnUpdate ( float deltaTime)
pure virtual

Called every game tick (~20 times per second).

Parameters
deltaTimeSeconds since last tick (usually ~0.05).
Returns
false to stop receiving ticks (not an error).

The documentation for this class was generated from the following file: