Repository navigation
API Modules
Lua API / Modules
Stages a table for publication after the exporting script initializes successfully.
| Parameter | Type | Requirement |
|---|---|---|
name |
string | Required, non-empty, unique across exporting scripts. |
values |
table | Required; the actual table to share. |
Export during script loading/initialization. A different owner cannot export the same name. Exporting two different tables under the same name during one pending initialization is an error. Failed initialization discards pending exports; unloading removes owned exports.
local public = { multiplier = 2 }
betamoon.modules:export("shared_settings", public)Construct the table inside modInit() and export it after preparing its contents.
Returns the published table with the supplied module name.
| Parameter | Type | Requirement |
|---|---|---|
name |
string | Required, non-empty exported module name. |
Errors: no published module with that name. The result is the shared table, not a detached copy.
-- Top level: dependencies = { "Settings Script" }
-- Inside modInit:
local settings = betamoon.modules:import("shared_settings")
local multiplier = settings.multiplierThe dependency names the exporter script's name, not its module name or filename. Do not rely on ordinary require
to establish BetaMoon dependency order.
Packaged mods may use ordinary require("path.to.module") for private files inside the same package. Those modules are
isolated and cached per mod generation. They are not published to other mods. Use betamoon.modules:export and
betamoon.modules:import for cross-mod sharing. See Packaged Lua mods.
- Installation
- Install scripts
- Getting started
- VS Code and LuaLS
- Examples
- Reload and compatibility
- Troubleshooting
- Changelog
Scripts and shared values
- Script lifecycle
- Packaged Lua mods
- Modules
- References and stacks
- Queries
- Overrides
- Minecraft constants
- Chat and positions
- Structured data
- Script configuration
- Particles
Blocks and items
- Multiblocks
- Blocks
- Block state and placement
- Block shapes and rendering
- Block callbacks
- Block ticks and redstone
- Items
- Fluids
- Item callbacks
- Tools and armor
- Materials
- Textures
Entities
- Entities
- Entity access and movement
- Entity lifecycle and data
- Entity health and loot
- Entity inventories and relationships
- Projectiles and pickups
- Entity presentation and sounds
- Living entities and AI
- Entity parts and sensors
Assets and audio
- Assets
- Models and animations
- Built-in Minecraft models
- Model appearances
- Blockbench workflow
- Audio
- Texture-pack overrides
Events and world actions
World generation
World systems
Inventories and screens
Recipes