Sueta

Commands Framework

1.0.8

The simplest commands registration! /hello <name:Text> <age:number>

·Plugin
  1. 1.0.8latestEvents updateAug 29, 2024
    - Create global events, event that are added by default to all created commands - onFinalized, event that is triggered when command is gettting finalized
    3 downloads
  2. 1.0.2https://github.com/jwdeveloper/CommandsFrameworkAug 27, 2024
    - Improve templates - Fix having primitive types are method parameters in templates - Fix issue where command arguments where not - Fix services for Singleton to Transient inside binding service
    15 downloads
  3. 1.0.1Annotations updateAug 25, 2024
    In this update I included commands registration with annotation. This is the most simple way of creating new commands Code (Java): public class ExampleCommand { @FCommand (pattern = "/hello <name:Text> <points:Number> <job:Text[Miner,Warrior,Fisherman]>", onBuilder = "onBuild", onValidation = "onValidation", onError = "onError" ) public void helloCommand (Player player, String name, double points, String job ) { player. sendMessage (ChatColor. DARK_GREEN + "Name: " + name + " points: " + points + " job" + job ) ; int i = 0 ; i = i / 0 ; //Forcing exception } public void onBuild (CommandBuilder builder ) { //Modifying commands properties before it is registered builder. argument ( "name" ). withDefaultValue ( "john" ) ; } public boolean onValidation (CommandValidationEvent event ) { event. sender ( ). sendMessage (ChatColor. YELLOW + "Validating command: " + event. args ( ). length ) ; return true ; } public void onError (CommandErrorEvent event ) { event. sender ( ). sendMessage (ChatColor. RED + "Handled exception: " + event. exception ( ). getCause ( ). getMessage ( ) ) ; } } public final class ExamplePlugin extends JavaPlugin { @Override public void onEnable ( ) { ExampleCommand exampleCommand = new ExampleCommand ( ) ; Commands commands = CommandsFramework. enable ( this ) ; commands. create (exampleCommand ). register ( ) ; } }
    16 downloads
  4. 2024-08-19Aug 19, 2024
    28 downloads

Similar projects

Plugin →