Particles addon
What does it do?
This addon gives you the ability to create particles that are being "emitted" by the portal. You can create your own "particle pack" and add it to your portal.
How is it configured
First, you need to create the folder ./plugins/Dimensions/ParticlePacks and create a .yml file inside of it.
That is the file that contains the particle behavior.The main body of the particle pack consists of 2 parts. The first one is the head(=start) and the second one is the body.
The head is a string list and is configured like so
You can only use numbers with or without decimal points for a variable. for example x = 1, x=1.1, x=1.111111111, etc
Now that we have set up some of the variables we will be needing, we will now head to the body of the "pack". The body splits into two sections that each splits into two other sections as well.
The first one is portal and is used when we want to spawn particles based on the center of the portal, while the second one is tile and we use this when we want to spawn particles for every single portal entity/block.
After we decide which one we want to use we can choose between for and play. Both will run every time the "script" is called (which is every 20 ticks(=1 second) according to "frequency" we set above in start). Their difference is that we use play when we want something to run only once while for is used when we want a single line to run multiple times with different values in the variables.
The body is spaghetti of string lists and is configured like so:
The for loop is made from 3 parts seperated by ";"
The first part is where we initiate our variable with a value (in the example we do i =0)
The middle part is where we tell it how many times to run. The loop will run while the middle part is true. So in the example we run the loop while "i" is below 50.
The last part will be used to change "i". Every time the whole "code" inside of the loop is run, the variable "i" will become i+1 and will run until "i" is < 50
The available commands are:
debug <text>
play <particle type> <x> <y> <z> <count> <offsetX> <offsetY> <offsetZ> [DustOptions(Color(<R>,<G>,<B>),<size>)]
The debug command will show variables but will not do any operations. If you want to output the result of an operation, save it in a variable first.
You can find the available particle types here.
DustOptions can only apply to redstone dust particles.
The for loops can have nested for loops inside of them. everything that is a child of for will run and if its a valid for loop everything inside of it will run aswell.
the output of this (for every <frequency> ticks) will be:
So if you used the command "play", instead of printing text, it would spawn particles instead.
If the for loop has not been set correctly and becomes an infinite loop, the server will crash.
Be careful when setting up the middle part of the for loop.
After you have created your pack, you can add it to a portal in its config like that:
Built-in variables
These are the variables you can use that are being given by Dimensions.
locX - x-axis of the location
locY - y-axis of the location
locZ - z-axis of the location
portalHeight - the height of the portal
portalWidth - the width of the portal
The location depends on where it's used. If it's under the tile section, it will correspond to each portal entity, and if it's under the portal tile, it will be the center of the portal.
Example
In this example, we will be making a particle pack that will create a circle around the portal.
First, we have the start block and we instantiate any variable we want to use.
Now that we have set up some of the variables we will be needing, we will now head to the main body of the "pack".
For this example, we want to use a for loop, for the center of the portal, so we will use portal
So when we want to make a circle around the portal, we will have something like this:
and it would result into this:
Last updated