Skip to content

API Reference

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 EventsServer-driven events like lifecycle & console behavior
Player EventsPlayer-driven events like connectivity & in-game behavior
ServerScriptObjectserverCommands, messaging, players, scheduling, state and persistence
PlayerScriptObjectEvent argument or server.get_player()Player state, permissions, messaging and persistent data
InventoryObjectplayer.inventoryItems, slots, inventory modifications and raw NBT
BackupManagerbackupSave, restore and configure server back-ups
AclManageraclOperators, bans, whitelist and global rules
AddonManageraddonSearch, download, import, and manage mods/plugins
ScriptManageramscriptSearch, download, import, and manage scripts
CoordinateObjectPlayer position, motion and rotation vectors
InventorySectionInventory slots, iteration, search and counting
ItemObjectItem data, NBT and inventory transfers
AclRuleBan, operator, whitelist and IP rule metadata
BackupObjectArchive metadata and saved back-ups
AddonFileObjectInstalled add-on metadata
AddonWebObjectOnline add-on metadata
AmsFileObjectInstalled script metadata
AmsWebObjectOnline script metadata
AmsVersionComparable Minecraft versions
AmsTimerDelayed, cancelable script callbacks
  • 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