package example; import net.rustexremake.api.Rsx; import net.rustexremake.api.RsxMod; /** * Example mod. It is compiled against the stable API only, so it does not have * to be rebuilt when the vendor re-obfuscates the client. */ public class ExampleMod implements RsxMod { private int ticks; @Override public void onLoad() { Rsx.info("ExampleMod: loaded on build " + Rsx.buildId()); Rsx.info("ExampleMod: Minecraft is " + Rsx.describe("net.minecraft.client.Minecraft")); // a repeating task runs on the game thread, driven by the client's own // tick, so touching game state here is safe Rsx.every(200L, new Runnable() { @Override public void run() { ticks++; Object mc = Rsx.minecraft(); Object player = Rsx.player(); Rsx.info("ExampleMod tick " + ticks + " client=" + (mc != null) + " player=" + player + " world=" + Rsx.world()); } }); } }