How can I find out which team a player is on?

Started by хомякъ on

Topic category: Help with modding (Java Edition)

Last seen on 08:12, 19. Jul 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I find out which team a player is on?

I was checking if the text contains the player's team, for example "team name". However, this didn't work. I will be grateful for your answer.

Last seen on 19:03, 13. Jul 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
create a player persistant…
Tue, 06/18/2024 - 15:58

create a player persistant string variable with the word set to name of team. 2 procedures. 1 is to set the variable and 1 is to do the command.

command procedure (/team (player) (team name)) (/team create (team name)

the variable is get team name in command and set it as variable.

But the easier way is to have team as a number and do /team (player) to  get the player's team and /team (player) set (number) for changing a team. I can help more later in detail but im kinda busy.

-PixelKid

Last seen on 08:12, 19. Jul 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
good
Wed, 06/19/2024 - 04:57

good

Last seen on 08:12, 19. Jul 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I decided to give it a try,…
Wed, 06/19/2024 - 07:15

I decided to give it a try, didn't understand anything, /team (player) you can't write like that. I do it on 1.20.1

Last seen on 19:03, 13. Jul 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
in the commands element name…
Mon, 06/24/2024 - 19:32

in the commands element name it team( or whatever) inside the element so when you type /team in chat it will act as a command to run variables and procedures. This should help: https://mcreator.net/wiki/making-command. the words in parentheses  are words that will differ. Example: (player) means they put the name of the target player for changing teams or viewing their team.

The procedure (not command) would be:

return:

get playerteamvariable of {get command element type player}.

That shows how to make the get player's team.

-PixelKid