Skip to content

Adds a bridge between Tebex store and SerenityJS minecraft server to automatically reward the player.

License

Notifications You must be signed in to change notification settings

TerraBloomBE/Tebexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tebexity

A lightweight Tebex integration plugin for SerenityJS.

Installation

npm install tebexity

Configuration

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: 120

Get 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

  1. Plugin polls Tebex API on the configured interval
  2. When a player with pending commands comes online, their commands are fetched
  3. The message event is emitted with the player and their commands
  4. Commands are automatically deleted from Tebex queue after emitting
  5. 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

About

Adds a bridge between Tebex store and SerenityJS minecraft server to automatically reward the player.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published