Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Script: Difference between revisions

From Leaf Essentials
script hook
 
No edit summary
 
Line 1: Line 1:
{{stub}}
= Hooks =
= Hooks =
Basic Hook Example
Basic Hook Example

Latest revision as of 12:14, 15 February 2026

This article is a stub. You can help by expanding it! :3

Hooks

Basic Hook Example

let ticks = 0;
let seconds = 0;
let tickHook = hook("tick", ()=>{
    ticks++;
    if(ticks % 20 == 0) {
        seconds++;
        mc.world.sendMessage("Hello, world!")
        if(seconds >= 5) {
            unhook(tickHook)
        }
    }
})
Contents