Uploaded July 2019 | Updated November 2026, 2 hours ago
In order to better track and debug in Asteroids VR I'd like to be able to track how fast the player is moving at any point in time. To do this we're going to add a simple tracking UI that displays our current velocity in meters per second and kilometers per hour using a canvas with a single Text element in it.
In order to grab the `velocity` we can just pull out the magnitude of the Rigidbody's `velocity`. Then to set this up we can calculate the our mps and kph values and assign the results to our Text object.
Check out more videos on the development of Asteroids VR: youtube.com/playlist?list=PLEwYhelKHmig7HVi7_WahwXRWPycEJ5xC
Join the World of Zero Discord Server: discord.gg/hU5Kq2u
In order to better track and debug in Asteroids VR I'd like to be able to track how fast the player is moving at any point in time. To do this we're going to add a simple tracking UI that displays our current velocity in meters per second and kilometers per hour using a canvas with a single Text element in it.
In order to grab the `velocity` we can just pull out the magnitude of the Rigidbody's `velocity`. Then to set this up we can calculate the our mps and kph values and assign the results to our Text object.
Check out more videos on the development of Asteroids VR: youtube.com/playlist?list=PLEwYhelKHmig7HVi7_WahwXRWPycEJ5xC
Join the World of Zero Discord Server: discord.gg/hU5Kq2u
 over our character controller to allow us to build modular pieces instead of a single monolithic character controller. In this video well take advantage of that design to add NUnit tests over our basic character controller. This should help allow us to validate the behavior of our character controller and ensure future changes do not negatively impact the stability of our game.
Unity includes NUnit testing already - a framework I am not familiar with - well be exploring how to setup some basic tests, build out a few custom Mocks for our classes and test the basic top down controller we had previously built. At the end of this well have test coverage over the movement action of our character controller that allows us to validate our player moving.
This video is specifically looking at unit tests, integration and end-to-end tests are larger more complex problems that Im not sure how we want to cover yet.
More NUnit documentation is available on GitHub: https://github.com/nunit/docs/wiki/NUnit-Documentation
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Introducing Testing into our Platformer](https://i.ytimg.com/vi/MVllsatsW5A/mqdefault.jpg)



 to your projects for common namespaces used in projects of the type youve chosen. This can help you get started more quickly in .NET by automatically importing common namespaces like `System` and `System.Linq` without you having to explicitly declare them somewhere in your projects.
You can turn on Implicit Usings in your .NET 6 projects by adding this line to your Project file.
```csproj
˂ImplicitUsings˃enable˂/ImplicitUsings˃
```
Implicit Usings introduce namespaces into the global space. You can learn more about how to add your own custom namespaces here by using `global` usings: https://youtu.be/z4THCW3b16k
Note: You can always check which implicit usings are being generated for your project by navigating to your projects `obj` directory and finding the generated file named: `[Your Projects Name].GlobalUsings.g.cs`.
You can find a more in-depth dive into this feature here: https://dotnetcoretutorials.com/2021/08/31/implicit-using-statements-in-net-6/
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Lets Explore Implicit Usings in C# 10](https://i.ytimg.com/vi/NlvhBpLl0DY/mqdefault.jpg)



 and Docker which allows us to create new commands inside of Minecraft and then Docker provides a container layer so we can easily reproduce new Minecraft servers. In this video were going to focus on how to create new commands with Spigots APIs.
To do this well need to implement a [`CommandExecutor`](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandExecutor.html). This is an interface which has a single `onCommand` function that needs to be Overridden. `onCommand` will then be invoked when the command is used in-game and will pass a number of useful properties into the function for you to use (like who used it and what arguments were used).
There are three configurations you need to make in order to actually get your new Command to execute though.
## `plugin.yml`
The first place you need to configure is the `commands` section of the `plugin.yml` which is used to define the properties of your plugin/mod. In order to do this youll need to add the following your `yaml` file.
```yaml
commands:
commandName:
description: A custom minecraft command in spigot
usage: /commandName
aliases: [commandAlias]
```
The `commandName` is the name of the Command. Players will see this in the servers auto-complete. The `commandName` is also used later to register the `CommandExecutor`.
The description describes what the command is for, usage is displayed as helper text for how to use the command and aliases are alternative ways to call the command. In this example `/commandAlias` could be used exactly like `/commandName`.
## `App.java`
This is the main entry point for your program. When our plugin is loaded we need to register the `CommandExecutor` to connect with the command setup in our `plugin.yml`. To set this up youll want to add something like this to your Apps `onEnable` function.
```java
MyCommandExecutor command = new MyCommandExecutor ();
this.getCommand(commandName).setExecutor(command);
```
Note: `commandName` should match your `commandName` from the `plugin.yml` above.
## `MyCommandExecutor.java`
The final piece of the puzzle is a class which implements `CommandExecutor`. This is the definition of the `CommandExecutor` you pointed to in the `App.java` code.
```java
public class MyCommandExecutor implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
sender.sendMessage(Ten four. Commencing operation dance off.); // 💃🕺
return true;
}
}
```
Once you have configured all three of these properties you should be able to build your plugin, install it on your server and run it. You should be able to type `/commandName` in your server and get Ten four. Commencing operation dance off. as a response.
***
MC-Clone is a project to create a Minecraft mod which will allow you to clone all or part of your current world into a brand new world with modified settings. For example copying your survival build into a creative world so you can test your next project. The mod will allow you to host these new servers in Docker and will also have some logic to shut down the custom servers once they become inactive so youre not running an ever increasing number of servers. These videos are my process of creating the plugin and what I learn along the way.
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Starting to Build a Spigot Minecraft Mod - Building MC-Clone - Part 1](https://i.ytimg.com/vi/ODLx4yJNtJA/mqdefault.jpg)

