Annotation-based command framework for Minestom

Related tags

CLI Minestand
Overview

Minestand

Annotation-based command framework for Minestom

Advantages over other frameworks

Minestand works by converting your classes into Minestom commands
All the command parsing, handling, etc. is done by Minestom, allowing this library to be relatively lightweight
Uses MethodHandles/LambdaMetaFactory for invokation instead of reflection

Getting Started

  1. Add Minestand as a dependency:
dependencies {
     implementation 'com.github.Moulberry:Minestand:-SNAPSHOT'
}
  1. Create a command (see below for example)
  2. Register the command using Minestand#register

Example Usage (from test/main/java/net/gauntletmc/command/examples)

getFruits(CommandSender sender, CommandContext context) { if (sender instanceof Player player) { if (player.getUsername().equalsIgnoreCase("moulberry")) { return List.of("mulberry"); } } return List.of("peach", "fig", "apple", "banana", "guava", "apricot"); } @Alias("echo") public static void print(Player sender, @Name("text") @Greedy @Completions("getFruits") String thingy) { sender.sendMessage(Component.text(thingy)); } @Alias("subcategory") public static class Subcategory { @Alias("ping") public static void ping(Player sender) { sender.sendMessage(Component.text("Pong!")); } } }">
@Alias("example")
public class CommandExample {

    @DefaultCommand
    public void thisIsDefault(Player sender) {
        sender.sendMessage(Component.text("Try /example echo"));
    }

    @RequiresPermission("your.permission.name")
    @Alias("teleportUp")
    public void teleportUp(Player sender, @Name("player") Player player, @Optional @Name("amount") int amount) {
        if (player == null) player = sender;
        player.teleport(player.getPosition().add(0, amount <= 0 ? 5 : amount, 0));
    }

    public static Collection<String> getFruits(CommandSender sender, CommandContext context) {
        if (sender instanceof Player player) {
            if (player.getUsername().equalsIgnoreCase("moulberry")) {
                return List.of("mulberry");
            }
        }
        return List.of("peach", "fig", "apple", "banana", "guava", "apricot");
    }

    @Alias("echo")
    public static void print(Player sender, @Name("text") @Greedy @Completions("getFruits") String thingy) {
        sender.sendMessage(Component.text(thingy));
    }

    @Alias("subcategory")
    public static class Subcategory {

        @Alias("ping")
        public static void ping(Player sender) {
            sender.sendMessage(Component.text("Pong!"));
        }

    }

}
You might also like...

A Minestom extension that opens the port that the Minestom server is running on!

OpenPortStom A project that uses weupnp to forward the port for you when starting your server, it will also attempt to close the port. Yes this is a s

Apr 24, 2022

Annotation/Reflection Based Bukkit Command API. Containing many features such as help-service, command providers, tab completion, and many more!

CommandAPI Annotation/Reflection Based Command API that just does what you want it to do without any problems. Importing Maven repository id

Jun 13, 2022

Java annotation-based framework for parsing Git like command line structures

Airline Airline is a Java annotation-based framework for parsing Git like command line structures. Latest release is 0.8, available from Maven Central

Nov 26, 2022

An annotation-based command framework for Bukkit

Blade Blade is an easy-to-use command framework based on annotations. It currently only supports Bukkit, but it can be easily extended to more platfor

Nov 6, 2022

Yet another Java annotation-based command parsing library, with Dependency Injection inspired by Guice

Commander A universal java command parsing library Building This project uses Gradle. Clone this repository: git clone https://github.com/OctoPvP/Comm

Oct 2, 2022

Operadora - A Minestom server implementation with basic features and supreme modularity 3

Operadora Operadora is a a Minestom server implementation with basic features, some utilities and full modularity. 3 Installation Download the latest

Dec 30, 2022

Scaffolding is a library for Minestom that allows you to load and place schematics.

This library is very early in development and has too many bugs to count. For your own safety, you should not use it in a production environment.

Nov 29, 2022

Arena is a demo server made with Minestom

Arena is a demo server made with Minestom, as both a showcase for what Minestom is capable of and as a way to teach developers how to work with Minestom.

Dec 29, 2022

Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

Oct 4, 2022

Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.

Derive4J: Java 8 annotation processor for deriving algebraic data types constructors, pattern matching and more! tl;dr Show me how to write, say, the

Nov 23, 2022

Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.

Derive4J: Java 8 annotation processor for deriving algebraic data types constructors, pattern matching and more! tl;dr Show me how to write, say, the

Nov 23, 2022

A powerful, extendable, flexible yet simple to use commands annotation framework.

Lamp Background Building commands has always been a core concept in many applications, and, lots of times, a really boring and cumbersome one to pull

Jan 5, 2023

Xerath - 🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

Xerath - 🔪  AOP development framework implemented through *Annotation + ASM + Gradle Transform API*  for Android🤖

简体中文 | English | Xerath Xerath 是一个通过 [自定义注解]+ASM + Gradle Transform API 实现的一套功能强大,方便开发,并且能够有效减少重复代码的Android Aop 框架。 旨在编译器进行全局性的修改,来完成一些诸如方法耗时统计,异常收集,拦

Nov 22, 2022

KickAss Configuration. An annotation-based configuration system for Java and Kotlin

KAConf 2016-2020 Mario Macías KickAss Configuration v0.9.0 is an Annotation-based configuration system inspired in the wonderful Spring Boot. Its stro

Nov 21, 2022

An annotation-based Java library for creating Thrift serializable types and services.

Drift Drift is an easy-to-use, annotation-based Java library for creating Thrift clients and serializable types. The client library is similar to JAX-

Dec 24, 2022

Configuration library based on annotation processing

net.cactusthorn.config The Java library with the goal of minimizing the code required to handle application configuration. Motivation The inspiring id

Jan 8, 2023

Command line parsing framework for Java

JCommander This is an annotation based parameter parsing framework for Java 8. Here is a quick example: public class JCommanderTest { @Parameter

Dec 29, 2022

☄️ LiteCommands - Command framework for Velocity and your other implementations.

☄️ LiteCommands Command framework for Velocity and your other implementations. Helpful links: Support Discord GitHub issues Panda Repository (Maven or

Dec 1, 2022
Owner
null
Command line parsing framework for Java

JCommander This is an annotation based parameter parsing framework for Java 8. Here is a quick example: public class JCommanderTest { @Parameter

Cedric Beust 1.8k Dec 29, 2022
A command line parser generator

jbock is a command line parser that works similar to airline and picocli. While most of these other tools scan for annotations at runtime, jbock is an

H90 73 Dec 13, 2022
Command-line API for Atlassian JIRA using the Tomitribe CREST library

Atlassian JIRA Command-Line (CLI) Jamira is a command-line API for Atlassian JIRA using the Tomitribe CREST library. Installation Jamira can be downlo

Tomitribe 12 Sep 10, 2022
DeV Tools - Swiss Army Knife of command line utilities

dvt aims to bundle all small utilities used by developers (typically a mix of cli and online tools) into one binary that you can simply use in the console. No need for complex pipe-ing, copy-pasting on different sites or keep installing cli utilities for every need.

Madalin Ilie 13 Sep 15, 2022
Wrapper around ping command for Windows and MacOS

Wrapper around ping command for Windows and MacOS. Extended with functionality to intercept results provided by the ping command output (latency, ttl and etc.)

Vladislav Kozlov 1 Jan 6, 2022
AWS JSON TRANSLATOR CLI is a command line application to translate JSON files using AWS Translate

A command line tool to translate JSON files using AWS Translate.

Marc Guillem 0 May 30, 2022
TransitScheduler - a command line tool that can read .json data formulated for tracking transit patterns to a multithreaded concurrent simulation of passengers boarding and unboarding trains that constantly move to the next station on the line. The trick here, is that two trains cannot occupy the same station at any time.

TransitScheduler - a command line tool that can read .json data formulated for tracking transit patterns to a multithreaded concurrent simulation of passengers boarding and unboarding trains that constantly move to the next station on the line. The trick here, is that two trains cannot occupy the same station at any time.

Emmet Hayes 1 Dec 2, 2022
Java library for creating text-based GUIs

Lanterna Lanterna is a Java library allowing you to write easy semi-graphical user interfaces in a text-only environment, very similar to the C librar

null 2k Dec 31, 2022
Spring based interactive shell

Spring Shell 3 Spring Shell 3 is a work to solely depend on Spring Boot 2.x and not trying to keep any backward compatibility with older Spring Shell

Spring 609 Dec 14, 2022