LuaCraft

From LuaCraft
Jump to: navigation, search

Getting started with LuaCraft

LuaCraft is a Minecraft Forge mod, that works both client and serverside. You will need Forge for Minecraft 1.7.2 to use our mod.

Right now we are processing the functions provided by our mod and they should be up soon. In the meantime you can check this link as a reference to the hooks provided by LuaCraft.

Code Examples

Here is a small example that uses two hooks and the entity meta function Entity.SetVelocity to launch the player into the air when jumping.

function entityFall(ent, distance)
    if (IsPlayer(ent)) then
        return true
    end
end
hook.Add("entity.fall", "Fall!", entityFall)

function entityJump(ent)
    local jumpVec = Vector(0, 0, 1.5)
    if (IsPlayer(ent)) then
        ent:SetVelocity(jumpVec)
    end
end
hook.Add("entity.jump", "Jump!", entityJump)