STOOL-API
An API for Minecraft Bedrock Edition ScriptAPI development.
STOOL-API is a feature-rich API for Minecraft Bedrock Edition ScriptAPI development, designed to facilitate server tool creation and improve player interaction through customizable and developer-friendly tools.
Note: This API is currently in development, so features may change in future versions.
Requirement: Make sure Education Edition & Beta-API are enabled.
Table of Contents
Features
- Easy configuration through JavaScript files.
- Customizable command system with support for prefixes and role-based access.
- Built-in teleportation, warps, and home systems.
- Robust logging and broadcast options.
- Player management capabilities, including role assignments, balances, and custom data storage.
- Plugin-based architecture for modular development.
Configuration
The API is configured via config.js
, which manages command prefixes, admin tags, logging, and other settings.
Config Path: config.js
Plugin System
STOOL-API supports a modular plugin system. You can easily add or remove plugins without altering core files. Plugins are registered in register.js
for easy management.
Plugin Registration Path: register.js
Command Handlers
The command handler system lets you define and organize commands efficiently. You can create commands with custom help messages, categories, and admin-only restrictions.
Command Handler Structure
Each command handler is a function that defines command logic, such as what actions to execute based on player input. Handlers also allow for custom prefixes, role-based restrictions, and usage help messages.
Handler Structure Example:
/**
* Command handler structure example.
* @type {Command<function>}
*/
let handler = function(event, context) {
// Command logic goes here
};
handler.commands = ["command_name"];
handler.helps = ["command_name <arg>"];
handler.category = "category_name";
handler.admin = false; // Set to true for admin-only commands
handler.custom_prefix = ["!", "/"]; // Optional custom prefixes
- handler.commands: An array of command names.
- handler.helps: Usage examples for the command.
- handler.category: The category under which the command falls.
- handler.admin: Boolean to restrict the command to admins.
- handler.custom_prefix: Array of prefixes specific to the command.
Installation
- Clone the repository:
git clone https://github.com/nperma/STOOL-API.git
- Install dependencies:
npm install
- Update the
config.js
file as needed. - Register plugins in
register.js
.
Usage
STOOL-API automatically loads registered plugins. To create new plugins:
- Define a command handler.
- Register it in
register.js
. - Reload the server (
/reload
) to apply changes.
Examples
Find example plugins here: plugins
Custom Prefix Example
Define custom prefixes to allow commands to be triggered with multiple options.
let handler = function(ev, { text, mc }) {
if (text) {
mc.world.sendMessage(text);
} else {
ev.sender.sendMessage("-_-");
}
};
handler.commands = ["say"];
handler.helps = ["say <text>"];
handler.custom_prefix = ["p.", "np!"];
handler.category = "twst";
export default handler;
Admin Command Example
Restrict commands to admin users by setting handler.admin = true
.
let handler = function(ev, { sender, tools, text }) {
tools.broadcast(`§d@${sender.name}§g: §e${text}`, `§5§l[§dMSB§5]§r §7»§r`);
};
handler.commands = ["msb", "modsbroadcast"];
handler.helps = ["msb <text>"];
handler.admin = true;
handler.category = "admin";
export default handler;
Contributing
We welcome contributions to STOOL-API! Feel free to submit a pull request or open an issue in our GitHub repository.
Contribution Guidelines
- Fork the repository.
- Create a feature branch (
git checkout -b feature/my-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to your branch (
git push origin feature/my-feature
). - Create a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Creator
This updated README.md
provides clearer instructions and example handler code for implementing custom commands in STOOL-API.
Supported Versions
Download Versions
ServerTool v1.0.6 PATCH
- adding properties rtp, Random Teleport Settings
- adding plugin
rtp-general
- adding cooldown for rtp
- adding plugin
warn-admin
- migrate CustomChat from
index.js
intochat-_system
plugin - fixed
format_chat
replacement - fixed ranks replacement
- update CustomChat with adding some prefix:
@PREFIX
prefix_rank display,@SUFFIX
suffix rank display,@RANK
current Rank display, update@NAME
- update
format_chat
: "@RANKS§r §a@NAME §r§7» §r@MSG
" => "@PREFIX@RANK@SUFFIX§r §a@NAME §r§7» §r@MSG
" - update notadmin message
- update plugin
player-_system
- adding plugin
scorehud-general
- adding plugin
scorehud-admin
- list prefixs
scorehud_display
: - <name>
- <rank>
- <rank_count>
- <death_count>
- <kill_count>
- <mute_count>
- <kick_count>
- <warn_count>
- <admin_count>
- <admin_online_count>
- <player_count>
- <player_online_count>
- <balance>
- <afk_time>
- <locale_date>
- <locale_time>
Comments
0Only registered users can leave comments. Please Login
No comments yet. Be the first to comment!