So my problem is pretty small and the datapack I am currently coding as well.
I want a simple command, where on execute the executer joins a team and if he already is in that team, he leaves it. Very simple. It is for an Server of mine, where a prefix should appear on command, so the team option is probably the easiest.
Problem is, that the command should look like /example
and not like /trigger example
.
Is that even possible with datapacks, or should I just use a plugin?
The datapack structure is pretty small, there are only two functions, the one that runs on load and the one running on ticks.
The creaton of the team btw looks like this:
# This is the creation of the Team
team add live
team modify live prefix {"text":"live ","color":"red","bold":true,"italic":true}
Also, if anybody knows how to use only this one command like I said to enable and disable the team, so detect, whether a player is already in that team or not that would also help a lot.
Unfortunately, there's no good way to create a command with a datapack without /trigger
.
You can use a plugin however, you just need a Paper or SpigotMC server.
There are lots of good resources for making plugins, but in my opinion the most useful is Spigot Plugin Development on the SpigotMC wiki. It details the entire process of making a plugin and is a good reference.