amscript exposes Minecraft and auto-mcs functionality through objects and event handlers. The engine supplies the global server, backup, acl, addon, and amscript objects; player objects are passed to events or obtained with server.get_player().
This reference covers the API itself. For creating, installing, and managing scripts, see Development or Using the IDE.
| |
|---|
| Server Events | Server-driven events like lifecycle & console behavior |
| Player Events | Player-driven events like connectivity & in-game behavior |
| | |
|---|
| ServerScriptObject | server | Commands, messaging, players, scheduling, state and persistence |
| PlayerScriptObject | Event argument or server.get_player() | Player state, permissions, messaging and persistent data |
| InventoryObject | player.inventory | Items, slots, inventory modifications and raw NBT |
| BackupManager | backup | Save, restore and configure server back-ups |
| AclManager | acl | Operators, bans, whitelist and global rules |
| AddonManager | addon | Search, download, import, and manage mods/plugins |
| ScriptManager | amscript | Search, download, import, and manage scripts |
- Parameters marked with
* in descriptions are required; other parameters are optional, unless stated otherwise
- Parameters in event constructors must be defined in the constructor. (for example,
@server.on_loop(interval=10, unit='tick')). They cannot be a variable, function, or reference because event constructors are compiled before runtime
- Methods and event handlers use normal Python syntax; amscript events begin with
@server. or @player. and are not Python decorators
- Object attributes are generally informational. Exceptions explicitly documented as writable, such as
player.gamemode and player.dimension, update the player through their setters
- Some functionality depends on the Minecraft version or server distribution, even where the API name is consistent
server.persistent and player.persistent keep state across normal restarts and script reloads; forced termination can prevent pending data from being written