Skip to content

MLua

By EncDataOwner

A mod that adds a scripting library to minecraft.

1k downloads Updated

No ratings yet

Be the first to rate it.

Rate it

Community listing page

Community listing page, reviews may not be monitored by the author.

About

Description

Logo

MLua
GitHub Stars Discord Modrinth

MLua lets you write Minecraft mod scripts in Lua. Scripts can interact with the game through APIs for players, worlds, events, commands, UI, and registered content.

API reference

MLua would generate its documentation in the Minecraft client. Open run/mlua/docs/index.html after launching the game. It shows you the APIs available in that build.

Example

local Players = Minecraft:GetService("Players")
local World = Minecraft:GetService("World")

Players.PlayerAdded:Connect(function(player)
    player:SendMessage("Hello from MLua!")
    player:SetGameMode(GameMode.Creative)
end)

World:SetWeather(Weather.Clear)

Using MLua from another mod

Include MLua with your mod and declare it as a dependency.