Skip to content

Development Assistance Plugin

OfficialDonut edited this page Feb 24, 2024 · 3 revisions

The Visual Bukkit plugin provides various features to assist plugin development with Visual Bukkit. The plugin jar can be found in the directory where you installed Visual Bukkit or it can be downloaded directly from the release page. The default configuration assumes that the Visual Bukkit app and the server with the plugin are running on the same machine, but it can be configured to work when the app and server are running on different machines/networks.

Commands

The permission to use Visual Bukkit commands is vb.command (defaults to ops).

Command Executable By Description
/vb help console/player Lists the available commands.
/vb reload console/player Reload the config.
/vb ping console/player Ping the Visual Bukkit app. Use this to confirm the Visual Bukkit plugin is able to communicate with the Visual Bukkit app.
/vb export item player Export the item that the player is holding.
/vb export loc player Export the player's current location.
/vb export block-loc player Export the location of the block at which the player is looking.
/vb export chest-inv player Export the inventory of the chest at which the player is looking.
/vb export error console/player Find the component in the Visual Bukkit project which caused the last exception to occur.
/vb deploy console/player Deploy the plugin jar to the server. The plugin jar will be copied into the plugin update folder (this is "plugins/update" unless you changed it in bukkit.yml). If there is a jar with the same name in the plugins folder it will be replaced by the jar in the update folder when you restart the server. Otherwise, you need to manually move the jar from the update folder to the plugins folder before restarting the server.

Debug Mode

Debug mode is used to find the cause of exceptions that occur in your plugin.

  1. Click the "Plugin Settings" button at the bottom.
  2. Click the "Build" tab
  3. Click the checkbox for enabling debug mode.
  4. Build the plugin and add it to your server.
  5. After an exception occurs run /vb export error.
  6. The Visual Bukkit app will navigate to the component that caused the exception.

Configuration

By default, the Visual Bukkit plugin attempts to communicate with the Visual Bukkit app on localhost port 50051 with no encryption.

Default plugin configuration: config.yml

grpc:
  host: localhost
  port: 50051
  tls:
    enabled: false
    truststore:
      file: C:\Users\Example\Desktop\VisualBukkit-Certs.p12
      password: password
    client-auth:
      enabled: false
      keystore:
        file: C:\Users\Example\Desktop\VisualBukkit-Plugin-Private.p12
        password: password
      key:
        password: password

Default app configuration: grpc.properties (located in the VisualBukkit6 directory in your home directory)

port=50051
tls.enabled=false
tls.keystore.file=C:\\Users\\Example\\Desktop\\VisualBukkit-Private.p12
tls.keystore.password=password
tls.key.password=password
tls.client_auth.enabled=false
tls.client_auth.truststore.file=C:\\Users\\Example\\Desktop\\VisualBukkit-Plugin-Certs.p12
tls.client_auth.truststore.password=password

Non-Localhost Server

If the app and plugin are on different networks:

  1. Enable port forwarding for TCP port 50051.
  2. Set grpc.host to your public IP in config.yml.

Enabling TLS is highly recommended if the app and plugin aren't on the same machine.

TLS

On your computer which has the Visual Bukkit app, use the Java keytool to generate a key pair and a self-signed cert:

keytool -genkeypair -keystore VisualBukkit-Private.p12 -alias VisualBukkit -storetype PKCS12 -keyalg RSA -keysize 4096 -validity 365 -ext "SAN=IP:<PUT YOUR PUBLIC IP HERE>"

Follow the prompts, it will ask for information to include in the cert, most of the fields can be left blank. Note that the VisualBukkit-Private.p12 file contains the private key so it should never be shared with anyone.

Update grpc.properties:

  1. Set tls.enabled to true
  2. Set tls.keystore.file to the file path of VisualBukkit-Private.p12
  3. Set tls.keystore.password to the password for the keystore.
  4. Set tls.key.password=password to the password for the private key (it's the same as the keystore password if you didn't set it)

Export the cert from the keystore:

keytool -exportcert -keystore VisualBukkit-Private.p12 -alias VisualBukkit -rfc -storetype PKCS12 -file VisualBukkit-Cert.pem

Import the exported cert into a new keystore:

keytool -importcert -keystore VisualBukkit-Certs.p12 -alias VisualBukkit -file VisualBukkit-Cert.pem -storetype PKCS12

Transfer VisualBukkit-Certs.p12 to the server which has the Visual Bukkit plugin.

Update config.yml:

  1. Set grpc.tls.enabled to true
  2. Set grpc.tls.truststore.file to the file path of VisualBukkit-Certs.p12
  3. Set grpc.tls.truststore.password to the password for the keystore.

Client Authentication

On the server which has the Visual Bukkit plugin, use the Java keytool to generate a key pair and a self-signed cert:

keytool -genkeypair -keystore VisualBukkit-Plugin-Private.p12 -alias VisualBukkit -storetype PKCS12 -keyalg RSA -keysize 4096 -validity 365"

Follow the prompts, it will ask for information to include in the cert, most of the fields can be left blank. Note that the VisualBukkit-Plugin-Private.p12 file contains the private key so it should never be shared with anyone.

Update config.yml:

  1. Set grpc.tls.client-auth.enabled to true
  2. Set grpc.tls.client-auth.keystore.file to the file path of VisualBukkit-Plugin-Private.p12
  3. Set grpc.tls.client-auth.keystore.password to the password for the keystore.
  4. Set grpc.tls.client-auth.key.password=password to the password for the private key (it's the same as the keystore password if you didn't set it)

Export the cert from the keystore:

keytool -exportcert -keystore VisualBukkit-Plugin-Private.p12 -alias VisualBukkit -rfc -storetype PKCS12 -file VisualBukkit-Plugin-Cert.pem

Import the exported cert into a new keystore:

keytool -importcert -keystore VisualBukkit-Plugin-Certs.p12 -alias VisualBukkit -file VisualBukkit-Plugin-Cert.pem -storetype PKCS12

Transfer VisualBukkit-Plugin-Certs.p12 to your computer which has the Visual Bukkit app.

Update grpc.properties:

  1. Set tls.client_auth.enabled to true
  2. Set tls.client_auth.truststore.file to the file path of VisualBukkit-Plugin-Certs.p12
  3. Set tls.client_auth.truststore.password to the password for the keystore.

VisualBukkit Discord: https://discord.gg/ugkvGpu

Clone this wiki locally