-
Notifications
You must be signed in to change notification settings - Fork 4
Plugin API Docs
There are 3 kinds of events available: chat, join, and leave.
Is called when a player sends a message to chat.
global.Brikkit.on('chat', evt => ...
Field | Description | Getter |
---|---|---|
Date | Date object containing the date the event happened on Brickadia. | evt.getDate() |
Sender | Player object with details of the sender | evt.getSender() |
Content | Content of the message | evt.getContent() |
Type | Type of the event ("chat") | evt.getType() |
Is called when a player joins the server.
global.Brikkit.on('join', evt => ...
Field | Description | Getter |
---|---|---|
Date | Date object containing the date the event happened on Brickadia. | evt.getDate() |
Player | Player object with details of the player who joined | evt.getPlayer() |
Type | Type of the event ("join") | evt.getType() |
Is called when a player joins the server.
global.Brikkit.on('leave', evt => ...
Field | Description | Getter |
---|---|---|
Date | Date object containing the date the event happened on Brickadia. | evt.getDate() |
Player | Player object with details of the player who left | evt.getPlayer() |
Type | Type of the event ("join") | evt.getType() |
These commands interface with the server, allowing you to interact with it. Only the commands that were deemed useful were added to this list.
Broadcasts a message to the whole server.
global.Brikkit.say('hello world!');
Saves the bricks in the server to a file.
global.Brikkit.saveBricks('seattle');
Loads the bricks from a file to the server.
global.Brikkit.loadBricks('seattle');
Get all builds that were saved as an unordered array, without the .brs
extension.
global.Brikkit.getSaves(saves => {
// loads the first save if it exists
if(saves.length > 0)
global.Brikkit.loadBricks(saves[0]);
});
DANGER: clears all bricks in the server.
global.Brikkit.clearAllBricks();
Sets the water level. Only works on Peaks.
global.Brikkit.setWaterLevel(10000);
Changes the map the server is running on. Will disconnect all players.
global.Brikkit.changeMap('Studio');
The maps available are: Studio_Night
, Studio_Day
, Studio
, Plate
, Peaks
.
Finds a player object by their username.
global.Brikkit.getPlayerFromUsername(username);
Returns the plugin system of the server, allowing you to load mods on the fly. Do not load plugins twice!
const pluginSystem = global.Brikkit.getPluginSystem(address);
pluginSystem.loadPlugin('example.zip'); // loads a plugin from a zip
pluginSystem.loadPlugin('hello world'); // loads a plugin from a directory
Returns the Brikkit scrapper, allowing you to scrape user profiles based on the user id.
const scraper = global.Brikkit.getScraper();
scraper.getProfile('402ff04c-a0f8-4d07-9471-801889fa0fb2', profile => {
console.log(`Hello ${profile.getUsername()}!`);
});
The join and leave events return a Player object, which must be further queried to retrieve more information. Details about these kinds of objects are available here.
Field | Description | Getter |
---|---|---|
Username | The user name of the player | getUsername() |
UserID | The user id of the player | getUserId() |
HandleId | The handle id of the player (similar to user id, but is only valid for a single play session) | getHandleId() |
Field | Description | Getter |
---|---|---|
Username | The user name of the player | getUsername() |
UserID | The user id of the player | getUserId() |
Gender | The gender of the player ('male', 'female' or null, if there is no gender selected) | getGender() |
Where | Whether the player is ingame or in real life (can be 'ingame' or 'outside') | getWhere() |
Last Seen | Date object representing when the player was last seen | getLastSeen() |
Location | The location of the player | getLocation() |
User Text | The user text of the player | getUserText() |