Olzie Development
HomeDiscord
  • Introduction
  • Minecraft Plugins
    • Player Auctions
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Auction Currency
          • Auction Product
          • Auction Converter
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
            • /api/playerauctions/getPlayerAuctionByID/{id}
            • /api/playerauctions/getRecentAuctionsByUUID/{page}
            • /api/playerauctions/getPlayerAuctions/{page}
            • /api/playerauctions/getAuctionCategoryByName/{categoryname}
            • /api/playerauctions/getAuctionCategories/{page}
            • /api/playerauctions/getAuctionPlayerByUUID/{uuid}
          • DELETE
            • /api/playerauctions/deleteRecentAuctionByID/{id}
        • Events
          • PlayerAuctionSellEvent
          • PlayerAuctionBuyEvent
          • PlayerAuctionBidEvent
          • PlayerAuctionBidWonEvent
          • PlayerAuctionRemoveEvent
          • AuctionExpireUpdateEvent
          • AuctionPlayerUpdateEvent
          • PlayerAuctionUpdateEvent
        • Errors
    • Player Economy
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Warps
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Warp Addon
          • Warp Map Addon
          • Warp Converter
          • Warp Currency
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
            • /api/playerwarps/getPlayerWarpByName/{warpname}
            • /api/playerwarps/getSponsorWarp/{id}
            • /api/playerwarps/getPlayerWarpByID/{id}
            • /api/playerwarps/getPlayerWarps/{page}
            • /api/playerwarps/getWarpCategoryByName/{categoryname}
            • /api/playerwarps/getWarpCategories/{page}
            • /api/playerwarps/getWarpPlayerByUUID/{uuid}
          • DELETE
            • /api/playerwarps/deletePlayerWarpByName/{warpname}
            • /api/playerwarps/deletePlayerWarpByID/{id}
        • Events
          • PlayerWarpTeleportEvent
          • PlayerWarpSponsorEvent
          • PlayerWarpRentEvent
          • PlayerWarpRemoveEvent
          • PlayerWarpCreateEvent
          • WarpPlayerUpdateEvent
          • PlayerWarpUpdateEvent
        • Errors
    • Player Businesses
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Trade
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Treasury
      • Commands & Permissions
      • Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Elections
      • Commands & Permissions
      • Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Night Market
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Market Currency
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
Powered by GitBook
On this page
  • Creating Commands
  • Registering
  • Examples

Was this helpful?

  1. Minecraft Plugins
  2. Player Warps
  3. Plugin API

Creating Commands

Here you can view details on how to create sub commands using the Commands Plugin API.

PreviousWarp CurrencyNextUsing Events

Last updated 4 months ago

Was this helpful?

Creating Commands

In Player Warps you can create a sub command that will allow you to create sub commands.

Registering

You can register the commands using the to register your command.

Here is an example to register your command, instance is your expansions' instance.

PlayerWarpsAPI.getInstance().getCommandRegistry().addSubCommand(instance);

Examples

Here is an example of a sub command class, this will let you be able to create sub commands.

import com.olziedev.playerwarps.api.warp.command.WCommand;
import org.bukkit.command.CommandSender;

import java.util.List;

public class ExampleCommand extends WCommand {

    public ExampleCommand() {
        super("example");
        this.executorType = ExecutorType.PLAYER_ONLY;
    }

    @Override
    public void execute(CommandSender sender, String[] arguments) {
        
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, String[] arguments) {
        return super.onTabComplete(sender, arguments);
    }
}

The executor type is the type of executor that can execute the command, you can set it to PLAYER_ONLY, CONSOLE_ONLY, or null for both.

The onTabComplete method is a optional the method that will show a list of strings that will be shown to the player.

CommandRegistry