Skip to content

Getting Started

Piggo41 edited this page Oct 13, 2026 · 5 revisions

Your first BetaMoon script

Home / Getting started

Install BetaMoon, then save the following as hello.lua directly inside the instance's .minecraft/betamoon/scripts folder.

name = "Hello BetaMoon"
version = "1.0.0"
description = "A first registered item and crafting recipe."

function modInit()
    local token = betamoon.items:add {
        id = 6000,
        key = "mymod:item/hello_token",
        displayName = "Hello Token",
        icon = { x = 10, y = 1 },
        maxStackSize = 16
    }

    betamoon.recipes:add {
        type = "shapeless",
        output = betamoon.stack(token, 1),
        ingredients = { betamoon.stack(280), betamoon.stack(331) }
    }
end

Choose another item ID if 6000 is already occupied. Use your own namespace in place of mymod for a lasting mod. Open BetaMoon's Scripts screen to inspect loading status and errors. In a world, craft one stick with one redstone dust to obtain the token.

name identifies this script for dependencies. modInit() registers the item and its recipe. items:add returns the item reference used by betamoon.stack to describe the recipe output.

Continue by topic

  • VS Code and LuaLS adds API completion and hover documentation to your editor.
  • Items describes every item declaration field.
  • Blocks introduces block declarations.
  • Callbacks adds behavior to item interactions.
  • Examples links to working scripts for each API area.

Use the Scripts screen or Ctrl+Shift+R to hot reload. Reload on save is optional and can be enabled in the BetaMoon config. Keep registered IDs stable when iterating on content used in saved worlds.

Clone this wiki locally