tebexity
v1.0.0
Published
SerenityJS Plugin that adds support for Tebex store intergration into minecraft server.
Readme
Tebexity
A lightweight Tebex integration plugin for SerenityJS.
Installation
npm install tebexityConfiguration
On first run, a config file is created at ./plugins/configs/tebexity/config.yml:
# Tebex API URL (don't change unless you know what you're doing)
url: https://plugin.buycraft.net
# Your Tebex server secret key
secret: ""
# How often to check for new purchases (in seconds)
checkInterval: 120Get your secret key from your Tebex server settings.
Usage
Listen for purchase commands in your plugin:
import { TebexManager } from "tebexity";
// In your plugin's onStartUp or onInitialize:
TebexManager.getInstance().on("message", (player, commands) => {
// player: Player - the online player who made a purchase
// commands: string[] - array of command strings to execute
for (const command of commands) {
// Handle the command however you want
// e.g. parse "give {username} diamond 64" and give items
console.log(`Executing for ${player.username}: ${command}`);
}
});How It Works
- Plugin polls Tebex API on the configured interval
- When a player with pending commands comes online, their commands are fetched
- The
messageevent is emitted with the player and their commands - Commands are automatically deleted from Tebex queue after emitting
- Offline players are ignored - their commands stay in Tebex queue until they join
Events
| Event | Parameters | Description |
|-------|------------|-------------|
| message | (player: Player, commands: string[]) | Fired when an online player has pending commands |
License
MIT
