Lukkit
  • Home
  • Getting Started
    • Installing Lukkit
    • Your First Plugin
    • Packing and Publishing
  • Storage
    • The StorageObject
    • Example
  • Commands
    • Command Options
    • Command Event
    • Examples
  • Gui
    • Create a simple inv
    • Create an advanced inv
    • Run function if an inventory item has been clicked
  • Events
    • Examples
    • Event List
      • Block
      • Enchantment
      • Entity
      • Hanging
      • Inventory
      • Player
      • Server
      • Vehicle
      • Weather
      • World
  • Globals
    • Global Functions
    • Global Variables
      • Plugin
      • Logging
      • Utilities
  • Wrappers
  • Examples
    • Discord Webhooks (http)
    • Toggle Fly
    • Hello, world!
Powered by GitBook
On this page
  1. Commands

Command Event

PreviousCommand OptionsNextExamples

Last updated 6 years ago

The command event is passed through the callback function of the method. This event has certain properties that can help you when creating the function of your command. This even is known as commandEvent in the . Look there to see how it is used.

  • commandEvent.isPlayerSender(): boolean Returns true if the sender of the command is a player or false otherwise.

  • commandEvent.isConsoleSender(): boolean Returns true if the sender of the command is the console or false otherwise.

  • commandEvent.isBlockSender(): boolean Returns true if the sender of the command is a block (e.g. command block) or false otherwise.

  • commandEvent.isEntitySender(): boolean Returns true if the sender of the command is an entity (can be a player) or false otherwise.

  • commandEvent.getSender(): Returns the sender of the command.

  • commandEvent.getArgs(): array Returns the arguments of the command.

  • commandEvent.getCommand(): string Returns the name of the command.

plugin.addCommand()
examples
org.bukkit.command.CommandSender