1

Trigger command using an ID.

vip2kea 2/18/21 3:28 pm history
164
2/22/2021 12:39 am
Hey, so I have been trying to make a datapack that would assign everyone who joins an ID, and moderators without OP can use that ID to put players on specific teams. Something like /trigger JoinBlueTeam set <ID>

For example, if a moderator typed the command /trigger JoinBlueTeam set 5. Billy, who has an ID of 5, would be put onto the Blue team.

If anyone knows how this could be done, please tell me. Studying other datapacks has not taught me much.
Posted by
vip2kea
Level 7 : Apprentice Miner
2

  Have something to say?

JoinSign in

5

HoboMaggot
02/19/2021 1:06 am
Level 55 : Grandmaster Blob
Note vanilla minecraft isnt very good for rank permissions.
If mods dont have op and they use trigger commands, that means normal people would also be able to use it.

I suggest you go to the r/MinecraftCommands discord and ask for help there. I cannot find a vanilla friendly way to make this work with non-op people and without using some complicated system.
1
vip2kea
02/19/2021 8:26 am
Level 7 : Apprentice Miner
history
The scoreboard enable @a[​tag=Moderator] Would make it so only people with the moderator tag could use the trigger.

I have seen simalar things on other datapacks,, I think it is possible I just have no idea how to do it.
1
HoboMaggot
02/19/2021 9:15 pm
Level 55 : Grandmaster Blob
Even if you set the value of 5 = Billy, You have to
Minecraft cannot execute within a function:
/execute if score @a JoinBlueTeam matches 5 run team join Blue_team <variable>

You have to manually state each id and person within the command which means it cant be automated
1
Francielly
02/22/2021 12:00 am
Level 8 : Apprentice uwu
history
actually it can be fully automated
you can execute as every players and do a simple comparation math to detect wich player is the right and then join the teams
1
Francielly
02/22/2021 12:39 am
Level 8 : Apprentice uwu
history
Hey vip2kea, here is a download link to an example I made, d o w n l o a d
~it is fairly simple, took me less than 15 minutes to do
~includes two teams, red and blue / you must have the tag "Moderator" to use the triggers
~all code is commented, so you can unzip the files and learn how I did it
(made for 1.17 but its compatible with 1.16 and probably even less)
2

Welcome