Repository navigation
API Chat and Positions
Lua API / Chat and positions
On this page
Displays a formatted local chat message. When a player is not yet available, up to 100 messages are queued and delivered when a player becomes available. The oldest message is discarded if the queue fills. Queued messages from an unloaded script are discarded.
betamoon.chat:send("Registered %i blocks", 3)Attempts to send a formatted message to all players through an accessible server. In singleplayer, falls back to local chat. If no server is accessible in multiplayer, reports a warning.
betamoon.chat:broadcast("Machine ready: %b", true)The chat formatter supports these tokens.
| Token | Value |
|---|---|
%i |
Integer. |
%d |
Number, formatted numerically including fractional representation. |
%b |
Boolean. |
%s |
String. |
%o |
Value converted to text. |
%% |
Literal percent sign; consumes no argument. |
Unsupported tokens, dangling %, wrong argument types, or extra/missing arguments produce a warning and suppress the message. Minecraft color sequences use §0–§9, §a–§f, and §r.
When a script name is available, it is prefixed to the message. This is the name from betamoon.mod.json for a
packaged mod, or the script's name metadata for a loose script. Otherwise, the message is unprefixed.
Returns a position containing integer x, y, z. All three arguments are required.
local position = betamoon.positions:integer(12, 64, -4)Returns a position with numeric x/y/z stored at single-precision float accuracy. All arguments required; represents coordinates without moving anything.
local position = betamoon.positions:float(12.5, 64, -4.5)Read the position through its x, y and z properties.
- 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