Skip to content

A small library for registering commands in java

License

Notifications You must be signed in to change notification settings

craftxbox/CMDLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMDLib Build status

A small library for registering commands in java.

Installation

Include the jar file as a library

Configuration

Have a config.json file at the run directory of your applicatio See the config.json file in the repository for syntax

Importing the Library

import tk.craftxbox.cmdlib.CommandStore
import tk.craftxbox.cmdlib.Command

Creating a Command Store

Make a public static variable at the beginning of your main class like this:

public static CommandStore cs = new CommandStore()

Making Commands

Commands are ECMAScript .js files placed at the directory specified in the config.json The name of the file determines the name of the command You may also add commands directly to the CommandStore with the registerCommand method

Executing Commands

To execute a command use the exec method in CommandStore with the name of the command to execute

Dependencies

Google GSON

About

A small library for registering commands in java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages