Uploaded January 2021 | Updated November 2026, 1 hour ago
Unity provides a few operators that can make some common tasks with quaternions easier to accomplish. You can multiple a quaternion and vector to rotate the vector by the provided quaternion's rotation or multiple two quaternions together in order to add the two rotations they represent together. These features make it easier to orient vectors in 3D space and can improve how you handle rotations (one common pattern I've seen that this can replace is the use `Quaternion.Euler` with a series of stored X, Y and Z rotations).
### Examples
If we wanted to rotate a forward facing vector by 45 degrees along the Y axis we might write something that looks like this:
```csharp
var originalVector = Vector3.forward;
var rotation = Quaternion.Euler(0, 45, 0);
var rotatedVector = rotation * originalVector;
```
Note: multiplying a quaternion and vector requires that the quaternion be on the left hand side of the operation and the vector be on the right hand side. You will see an error otherwise. Use `Quaternion * Vector` not ~~`Vector * Quaternion`~~.
To perform a 90 degree rotation around the X, Y and Z axis you might do this:
```csharp
var x = Quaternion.Euler(90, 0, 0);
var y = Quaternion.Euler(0, 90, 0);
var z = Quaternion.Euler(0, 0, 90);
var rotation = x * y * z; // Add the three rotations above
```
***
Unity has provided additional examples and documentation for `Quaternion` multiplication operations here: docs.unity3d.com/ScriptReference/Quaternion-operator_multiply.html
Join the World of Zero Discord Community: discord.gg/hU5Kq2u
Unity provides a few operators that can make some common tasks with quaternions easier to accomplish. You can multiple a quaternion and vector to rotate the vector by the provided quaternion's rotation or multiple two quaternions together in order to add the two rotations they represent together. These features make it easier to orient vectors in 3D space and can improve how you handle rotations (one common pattern I've seen that this can replace is the use `Quaternion.Euler` with a series of stored X, Y and Z rotations).
### Examples
If we wanted to rotate a forward facing vector by 45 degrees along the Y axis we might write something that looks like this:
```csharp
var originalVector = Vector3.forward;
var rotation = Quaternion.Euler(0, 45, 0);
var rotatedVector = rotation * originalVector;
```
Note: multiplying a quaternion and vector requires that the quaternion be on the left hand side of the operation and the vector be on the right hand side. You will see an error otherwise. Use `Quaternion * Vector` not ~~`Vector * Quaternion`~~.
To perform a 90 degree rotation around the X, Y and Z axis you might do this:
```csharp
var x = Quaternion.Euler(90, 0, 0);
var y = Quaternion.Euler(0, 90, 0);
var z = Quaternion.Euler(0, 0, 90);
var rotation = x * y * z; // Add the three rotations above
```
***
Unity has provided additional examples and documentation for `Quaternion` multiplication operations here: docs.unity3d.com/ScriptReference/Quaternion-operator_multiply.html
Join the World of Zero Discord Community: discord.gg/hU5Kq2u

 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)



- [TheNaturalTanuki](https://github.com/TheNaturalTanuki)
- [BaalEvan](https://github.com/BaalEvan)
For their contributions!
As time permits well also take a look at some of the other projects weve been working on and poke around with adding new features to those. Open Source Contributions and Other Projects](https://i.ytimg.com/vi/POVJ-QIyygE/mqdefault.jpg)





