Mineuniverse
Log in Register
Plugins

JSONAPI-Commands

Listen on ingame /commands via JSONAPI
by _ForgeUser8585389
Download Claim this project
7,367 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Admin Tools Chat Related Developer Tools Informational Website Administration

JSONAPI-Commands

With JSONAPI-Commands you can easily register real ingame commands like /spawn or /tp silvinci Notch.
This is it. No downsides. No quirky hacks. It just works. You don't even get these pesky Unknown command messages.

Installation

Download the latest version of JSONAPI-Commands and put it in your server's plugins directory. If you haven't already grab the latest version of JSONAPI and put in the very same directory.

How it works

JSONAPI-Commands listens on the PlayerCommandPreprocessEvent, that is fired whenever a player (it has to be a player, console doesn't count) enters a command. As the name suggests it is called before any other plugin or Bukkit itself can interfere. This way we can cancel the whole command and noone will ever notice, that in reality the issued command never was officially registered.

Configuration

JSONAPI-Commands creates a commands.yml in the JSONAPI folder. This file is pretty self-explanatory. It contains all registered commands and may be edited by hand. This file survives server reloads and restarts. This way you're programs don't have to re-register (refer to 'Methods') their commands all the time, nevertheless I do encourage you to implement checks into your software. You'll never now what can possibly happen.

How to use it

JSONAPI-Commands introduces new methods and a stream to @alecgorge's great JSONAPI.

Methods

  • addListener(String command) registers the given command
  • addListeners(String[] command) registers the given commands
  • removeListener(String command) removes the given command
  • removeListeners(String[] command) removes the given commands
  • removeAllListeners() removes all listeners (use with caution!)
  • allListeners() returns an array of all registered commands

Stream

The new stream is named commands. This means you can subscribe to it with this URL:

/api/2/subscribe?json={"name":"commands","username":"yourName","key":sha256("yourName"+"commands"+"yourPassword"+"yourSalt")}

A sample (prettifyed) response for /tp silvinci Notch run by the player alecgorge may look like this:

{
  "result": "success",
  "source": "commands",
  "success": {
    "time": 1353715957,
    "command": "tp",
    "args": ["silvinci", "Notch"],
    "player": "alecgorge"
  }
}
  • time is the exact timestamp when the command was issued
  • command is the command issued
  • args is an array of the arguments concatenated to the command (no args = empty array)
  • player is the player who issued the command (not the affected player)

Examples

... will follow shortly.

Help

1.0.1
MC 1.5.1
Release 2013-04-14 Get
1.0.0
MC CB 1.4.7-R0.1
Release 2013-01-17 Get
1.0.0
MC CB 1.4.5-R0.2, CB 1.4.5-R0.1
Release 2012-11-24 Get

You Might Also Like

AdBolt Advertising Network
Make money from your Minecraft server by running ads!
9,992
Mineload
Mineload
9,978
BeastTP
BeastTP v1.0 - Teleportation Made Easy! -[Permissions][1317]
9,966
RegionManager
generate regions with just one command!
9,950
TimeKeeper
Keep the Server-Playtime per Day
9,948
SimpleAdmin
simple way to ban/kick unwanted players from your server
9,945