Plugin API

Every hook, global and type a plugin can reach. The reference is generated from author_globals.d.luau, the declaration the marketplace builder typechecks uploads against, so what is listed here is what an upload may call.

Types
938
Methods
5,100
Fields and constants
3,339

Before you start

  • The API is a set of globals, not a module. require loads your own files from src/; a package import such as require("@bento/sdk") is rejected at upload.
  • Casing says which kind a global is. Lowercase ones (player, scene, bank) are the live game, read fresh in every callback. Capitalised ones (Skill, VarbitID, WorldPoint) are constants and constructors that never change.
  • A plugin is the object Plugin.new{...} returns, and its hooks are methods on it: function plugin:onGameTick(event). The Plugin page lists every one, and the guide walks through a complete plugin.
  • For completion and typechecking in your editor, point luau-lsp at author_globals.d.luau.

Plugin

1 type

The object Plugin.new{...} builds and src/main.luau returns, with every hook the host reads from it.

The game

59 types

The live game. Lowercase globals, refreshed for every callback; reading one outside a callback raises.

bank
Bank open, deposit and withdraw, the PIN, and loadouts.
client
Client session flags, world membership, and host preferences.
grandExchange
Grand Exchange offers, collecting, and the restock machine.
manager
The loot and sustain machines.
player
The local player: walking, webwalking, vitals, inventory, gear, combat, magic and prayer.
scene
NPCs, players, objects, ground items, and reachability.
shop
Shop stock and buy/sell actions.
ui
The game's interface: tabs, keys, dialogues, widgets, and the host's dialogs.
utils
Elapsed time, for measuring.
world
The world directory, world hopping, and PvP threats.

Constants

306 types

Capitalised globals: constants and constructors, fixed for the life of the plugin and safe to keep.

AnimationID
Animation ids by name, and names by id.
Asset
Read bundled plugin assets as text or bytes.
AttackStyle
Which combat style is selected.
BreakManager
Scheduled breaks for this plugin, set up by the player.
ChatMessageType
Chat message types, as onChatMessage reports them.
ColorUtil
Colour helpers for overlays and panels.
DrawLayer
Which layer renderOverlay is drawing.
Humanizer
Scheduled short and AFK pauses for this plugin.
InteractKind
What an actor is interacting with.
InterfaceID
Interface group and component ids, both directions.
Json
Parse and encode JSON on the host.
QuestState
Where a quest stands: QuestState.FINISHED.
RequirementStatus
Whether one spell requirement is satisfied.
RunStatus
Where a state machine stands: running, done, blocked or idle.
Skill
The skills, as constants: Skill.ATTACK.
VarbitID
Varbit ids by name, and names by id.
VarClientID
Client-var ids by name, and names by id.
VarPlayerID
Varplayer ids by name, and names by id.
WebwalkResult
How a webwalk ended, or that it has not.
WidgetConfig
Click-mask bits for a widget component.
WorldPoint
Build a tile and do arithmetic on it.

Entities

29 types

What stands in the world and what describes it: actors, objects, items, widgets and their definitions.

Coordinates

2 types

The ways of naming where something is.

Queries

6 types

Builders that narrow the scene and containers down to what you are looking for.

By domain

The types a lowercase global returns, filed under that global: Inventory sits under player because player:inventory() is how you reach it.

player

149 types

world

7 types

bank

6 types

scene

16 types

ui

8 types

manager

5 types

grandExchange

3 types

shop

1 type

pluginManager

2 types

eventBus

3 types

configManager

12 types

tooltipManager

2 types

itemManager

2 types

modelOutlineRenderer

1 type

timer

2 types

http

3 types

notifier

1 type

discordService

2 types

itemStatChanges

3 types

worldService

2 types

hiscoreManager

2 types

chatClient

2 types

menuManager

1 type

chatCommandManager

1 type

ungrouped

5 types

Passed to hooks

13 types

Passed only to hooks: the draw surface, the panel, the window, and event objects.

Options you pass in

38 types

Records you build and pass to a call.

Compatibility classes

243 types

Stand-ins for Swing, AWT, the JDK and third-party library classes. They exist for ports, and new plugins do not need them: see the translation guide.