diff --git a/docs/example.js b/docs/example.js index d350ba7..3af0620 100644 --- a/docs/example.js +++ b/docs/example.js @@ -1,7 +1,3 @@ -function runCode() { - if (document.pointerLockElement != null){//if pointerlock is enabled (the player is in game) - ModAPI.displayToChat({msg: "hello"}) - ModAPI.displayToChat({msg: "welcome to eaglerforge!"}) - } -} -var intervalId = setInterval(runCode, 50);//run the code in a loop \ No newline at end of file +ModAPI.addEventListener("update", () => { + ModAPI.displayToChat({msg: ModAPI.uwuify({string:"hello this is a example mod!"})}) +}); \ No newline at end of file diff --git a/docs/guide/how-to-install-mods.md b/docs/guide/how-to-install-mods.md index 759244f..0e42c8c 100644 --- a/docs/guide/how-to-install-mods.md +++ b/docs/guide/how-to-install-mods.md @@ -10,11 +10,7 @@ url : https://raw.githubusercontent.com/eaglerforge/eaglerforge.github.io/main/d the code inside of the example mod : ``` -function runCode() { - if (document.pointerLockElement != null){//if pointerlock is enabled (the player is in game) - ModAPI.displayToChat({msg: "hello"}) - ModAPI.displayToChat({msg: "welcome to eaglerforge!"}) - } -} -var intervalId = setInterval(runCode, 50);//run the code in a loop +ModAPI.addEventListener("update", () => { + ModAPI.displayToChat({msg: ModAPI.uwuify({string:"hello this is a example mod!"})}) +}); ``` \ No newline at end of file