**Topic category:** User side tutorials

## Features

Math Utils adds the following variables.

- Random Source
- Vector
- Vector List
- Vector Map

### Random Source

Random Source is a variable required to generate random numbers.

In order to generate random numbers, you will need to create a random source. If the source is used without creating, errors will occur.

The seed is a number required to calculate random numbers, and it can fixes the sequence of those.

Next, get random numbers with the source.

Note that random numbers are not automatically synchronized between client and server side.

### Vector

Vector is a variable which can have 3 numbers as X, Y and Z value.

In order to create a vector from numbers, do it like this. If a vector is not created, a zero vector (x, y, z) = (0, 0, 0) is used as an initial value.

For yaw and pitch values, vectors follow Minecraft's coordinate system.

These procedures can get each of numbers.

To do easy operations for vectors, these procedure are available.

The operations are done for each X/Y/Z component of numbers in vectors. For example, "(0, 1, 2) + (3, 4, 5)" is "(3, 5, 7)."

### Vector List

Vector List can store vectors using index numbers.

You will need to create a vector list at first. If the list is used without creating, errors will occur.

### Vector Map

Vector map can store vectors using string keys.

You will need to create a vector map at first. If the map is used without creating, errors will occur.

The load factor is a reference value to expand the map.

When the current size reaches the maximum size * the load factor, the map size will be expanded.

Hi, I have a question. What is the random source seed supposed to be (Integer, positive number etc.) and how does it work? I tried using the random number based on seed [ world seed + x + z ] for feature world gen but it was the same on every single world seed. It would really help to know more about the random source seed system. Will you update this plugin to 2024.2 when it releases? Thank you for making this plugin and hopefully helping me

I'm planning to add a procedure to create a random source from a block position. I'm still thinking about random source for seed values. 2024.2 will be released soon.

I´m looking forward to an update with this feature. Thank you for helping

Sorry to disturb again but it feels like the random source operation isn´t random. What pseudo random function do you use for this? If it isn´t Xorshift, could you add a "bitwise shift"-function to make a Xorshift generator possible in Mcreator?

It seems linear congruential generators according to the source code.

Bit shifting will be added in v1.3.0.

Thank you so much :)Both the lcg I manually programmed and the random source seemed to have an issue so I hope your plugin will help me trying the easiest alternative, the Xorshift. Great work!