Commands in Visual Bukkit 6

Commands in Visual Bukkit 6

Commands in Visual Bukkit 6 are surprisingly easy to set up—and fun too! If you’re more of a visual learner (or just don’t like reading), feel free to check out my video guide instead:

Command component

Adding the component

To add the Command, go to add component and under type, select command. Optionally, give your command a name (this is just for organizing—it doesn’t affect the actual command)

The properties:

The component consists of 5 parts:

  • Name – The base name of the command (e.g., /hello). No arguments here!
  • Alias – Alternative names, separated by commas (e.g. hi, hey, greetings)
  • Description – Shown when running /help <command>
  • Permission – Restrict usage (e.g., use.hello.myplugin or op)
  • Permission Message – Message shown when the sender lacks permission
  • Usage – Help message shown via /help <plugin>

Other useful blocks

Commands in Visual Bukkit 6 also have other useful blocks:

  • Command Sender: The player/console that executed the command. Useful for sending a message specifically to the command sender.
  • Command Argument: Retrieves a single argument by index (starts at 0)
  • Command Arguments: Grabs all arguments as a list

For instance:

/msg <player> Hello there!

Command Argument 0 → <player>

Command Argument 1 → Hello

Command Argument 2 → there!

Command Arguments → ["<player>", "Hello", "there!"]

Example of command usage:

Let’s walk through a basic example: sending a custom message to the person who ran the command.

First add your command. You’ll now see the purple box, which you can fill in however you like. I did mine just like the first picture.

Next, we’re going to add a method to send the message. If you don’t know what methods are, I highly recommend watching my video about events where I explain the basic Java terminology.

We’re selecting the Player class, after which we select sendMessage(String).

The player is the Command Sender block. The message can be colored with colored String, which you can add by right clicking and searching for it. You can now add colors to your message with the ‘&’ tag!

Official (but outdated) documentation

Find here the official, but little outdated documentation of Visual Bukkit 6:

https://github.com/OfficialDonut/VisualBukkit/wiki/Commands

If there is something wrong or outdated, let me know in the comments!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *