source: multiplayer

reasoning: Use @a[name=!slingshooter08] to target all players except the requesting player. The '!' negates the name filter.

commands: give @a[name=!slingshooter08] minecraft:diamond 1

error: This gives diamonds to ALL players including the requester. Use @a[name=!slingshooter08] to exclude a specific player.

difficulty: easy

extracted_from: multiplayer_training, Minecraft 1.21 command reference


reasoning: This is a very destructive command that kills players. Risk level 1. Players would lose inventory items and XP. Need to confirm this is intentional. Could use @a[tag=!admin] if admins are tagged.

error: This kills ALL players including admins. Must use a tag or name exclusion to protect admin players.


reasoning: Use 'team add' to create a team, then 'team modify' to set color. Team names are case-sensitive identifiers. Color affects name display and glowing outline.

commands:
team add red
team modify red color red
team modify red friendlyFire false

commands:
team add Red
team modify Red color Red

error: Color value must be lowercase ('red' not 'Red'). Team name can be anything but the color option requires exact lowercase color names.


reasoning: Use 'team join' with team name and player name. Player's name will appear in team color.

error: 'team add' creates a new team, not adds a player. Use 'team join <team> <player>' to add a player to an existing team.


user_message: show everyone's kill count on the sidebar

reasoning: Create a scoreboard objective that tracks player kills using the 'playerKillCount' criterion. Then display it on the sidebar.

commands: scoreboard objectives add kills playerKillCount "Player Kills"

commands: scoreboard objectives setdisplay sidebar kills

commands: scoreboard objectives setdisplay sidebar kills

error: Using 'dummy' criterion requires manual score updates. Use 'playerKillCount' to automatically track kills.

difficulty: medium


reasoning: Use 'deathCount' criterion to automatically track player deaths. Display on sidebar so all players can see.

commands: scoreboard objectives add deaths deathCount "Deaths"

commands: scoreboard objectives setdisplay sidebar deaths

commands: scoreboard objectives add deaths killed_by

commands: scoreboard objectives setdisplay sidebar deaths

error: 'killed_by' is not a valid criterion by itself -- it needs an entity type suffix like 'killed_by:minecraft.zombie'. Use 'deathCount' to track all deaths.


reasoning: Use 'execute at slingshooter08 run tp @a ~ ~ ~' to teleport all players to slingshooter08's position. The 'at' sets position context so ~ ~ ~ resolves correctly.

commands: execute at slingshooter08 run tp @a ~ ~ ~

error: While 'tp @a slingshooter08' works to teleport everyone to a player, the execute chain form is preferred as it allows more flexibility and is consistent with the chain pattern.


reasoning: Use @p[distance=1..] to select the nearest player excluding the command executor (distance=1.. means at least 1 block away). Give them a diamond as a default gift.

commands: give @p[distance=1..] minecraft:diamond 1

error: @p without distance filter selects the absolute nearest player which could be the sender themselves (if run as a player). Use @p[distance=1..] to exclude self.


reasoning: Use instant_health effect to heal all players. Amplifier 1 gives a strong heal. Duration of 1 second is sufficient since it's instant.

commands: effect give @a minecraft:instant_health 1 1

commands: effect give @a minecraft:regeneration 1 1

error: Regeneration heals slowly over time. For immediate full heal, use minecraft:instant_health which applies healing instantly.


reasoning: Create a custom bossbar with 'bossbar add', set its name, color, and assign it to all players. Bossbars appear at the top of the screen.

commands: bossbar add minecraft:game_timer "Game Timer"

commands: bossbar set minecraft:game_timer color red

commands: bossbar set minecraft:game_timer players @a

commands: bossbar set minecraft:game_timer visible true

error: Bossbar ID needs namespace (minecraft:game_timer) and the name must be a JSON text component or quoted string. Use 'bossbar add minecraft:game_timer "Game Timer"'.


reasoning: Create both teams, set their colors, and optionally configure friendly fire settings. This is a common setup for minigames.

commands:
team add red
team modify red color red
team modify red friendlyFire false
team add blue
team modify blue color blue
team modify blue friendlyFire false

commands:
team add red Red
team add blue Blue

error: The second argument to 'team add' is the display name, which should be a JSON text component or quoted string. Also missing color configuration with 'team modify'.


user_message: give speed to players within 20 blocks of me

reasoning: Use @a[distance=..20] to select players within 20 blocks. Need to run 'execute at slingshooter08' first so distance is calculated from the right position.

commands: execute at slingshooter08 run effect give @a[distance=..20] minecraft:speed 30 1

commands: effect give @a[distance=..20] minecraft:speed 30 1

error: Without 'execute at slingshooter08', the distance selector calculates from the command source (console), not from the player's position.


reasoning: Use 'tag add' to give the player a tag. Tags can be used in selectors like @a[tag=vip] for targeting.

error: Incorrect argument order. Correct syntax is 'tag <entity> add <tag>', not 'tag add <entity> <tag>'.


reasoning: Use the tag selector @a[tag=vip] to target only players with the 'vip' tag. This assumes the tag was previously assigned.

commands: give @a[tag=vip] minecraft:golden_apple 1

commands: give @a[tag=VIP] minecraft:golden_apple 1

error: Tags are case-sensitive. 'VIP' would not match tag 'vip'. Always use exact case.


user_message: select 3 closest players and give them arrows

reasoning: Use @a[limit=3,sort=nearest] to select the 3 closest players. The sort=nearest orders by distance and limit=3 caps the count.

commands: give @a[limit=3,sort=nearest] minecraft:arrow 64

error: Without sort=nearest, @a with limit picks players in join order (oldest first), not by distance. Add sort=nearest for proximity-based selection.


user_message: pick a random player and strike them with lightning

reasoning: Use @r to select a random player. Need 'execute at' for position context when summoning lightning at the random player's location.

commands: execute at @r run summon minecraft:lightning_bolt ~ ~ ~

commands: execute as @r run summon minecraft:lightning_bolt ~ ~ ~

error: 'execute as' without 'at @s' doesn't set position. Lightning would spawn at command source, not the random player. Use 'execute at @r' instead.


user_message: set my score to 10 on the kills objective

reasoning: Use 'scoreboard players set' to manually set a player's score on an objective.

commands: scoreboard players set slingshooter08 kills 10

error: Missing 'players' subcommand. Correct syntax is 'scoreboard players set <player> <objective> <value>'.


reasoning: Use 'scoreboard players add' to increment a player's score by a specified amount.

commands: scoreboard players add slingshooter08 kills 5

commands: scoreboard players set slingshooter08 kills +5

error: 'scoreboard players set' with '+5' is not valid. Use 'scoreboard players add' to increment scores.


reasoning: This is an informational question about target selectors. @p = nearest player, @r = random player, @a = all players, @e = all entities, @s = executing entity (self).

commands: tellraw slingshooter08 [{"text":"Target Selectors:\n","color":"gold"},{"text":"@p","color":"green"},{"text":" = nearest player\n"},{"text":"@r","color":"green"},{"text":" = random player\n"},{"text":"@a","color":"green"},{"text":" = all players\n"},{"text":"@e","color":"green"},{"text":" = all entities\n"},{"text":"@s","color":"green"},{"text":" = self (executor)"}]

commands: say @p = nearest, @r = random, @a = all players, @e = all entities, @s = self

error: Using 'say' would resolve the selectors to actual player/entity names. Use 'tellraw' with text components to display selector symbols literally.

extracted_from: multiplayer_training, Minecraft 1.21 knowledge base


reasoning: Use 'team leave' to remove a player from their team. The player is removed from whatever team they're on.

error: 'team remove' deletes the entire team, not a player from it. Use 'team leave <player>' to remove a player from their team.


user_message: teleport all survival players to the arena at 100 70 200

reasoning: Use @a[gamemode=survival] selector to target only survival players, then tp to absolute coordinates.

error: This teleports ALL players including spectators and creative mode players. Use @a[gamemode=survival] to target only survival players.


user_message: make team chat only visible to the same team

reasoning: Use 'team modify <team> nametagVisibility' and 'team modify <team> seeFriendlyInvisibles true' for team features. For chat, set the player's chat mode. However, vanilla Minecraft doesn't have built-in team-only chat. Closest is 'teammsg' (tm) command.

commands: tellraw slingshooter08 {"text":"Use /tm <message> to send team-only messages!","color":"gold"}

error: 'chat' is not a valid team modify option. Team-only chat is done with the /teammsg (or /tm) command, not a team setting.


user_message: make the red team nametags invisible to enemies

reasoning: Use 'team modify red nametagVisibility hideForOtherTeams' to hide nametags from players on different teams. Red team members can still see each other's nametags.

commands: team modify red nametagVisibility hideForOtherTeams

error: 'false' is not a valid nametagVisibility option. Valid values: always, never, hideForOtherTeams, hideForOwnTeam.


reasoning: Set friendlyFire to false on the team. This only prevents team members from hurting each other. For full PvP disable, need server config or gamerule.

error: 'pvp' is not a valid team option. The correct option is 'friendlyFire'. Note this only prevents team-on-team damage, not cross-team PvP.


user_message: show the kills scoreboard below player names

reasoning: Use 'scoreboard objectives setdisplay belowName kills' to show the kills objective under each player's nametag in the world.

commands: scoreboard objectives setdisplay belowName kills

commands: scoreboard objectives setdisplay below_name kills

error: 'below_name' is not valid. The correct display slot is 'belowName' (camelCase).


user_message: give everyone on the blue team a blue leather helmet

reasoning: Use @a[team=blue] selector. In 1.21, leather armor color uses component syntax: [dyed_color=255] for blue (RGB where blue = 255).

commands: give @a[team=blue] minecraft:leather_helmet[dyed_color=255] 1

commands: give @a[team=blue] minecraft:leather_helmet{display:{color:255}} 1

error: Old NBT format. In 1.21, use component syntax: minecraft:leather_helmet[dyed_color=255], not the {display:{color:}} NBT format.


reasoning: Use 'scoreboard players reset' with @a to clear all player scores on the kills objective.

error: While setting to 0 works visually, 'reset' actually removes the score entry entirely, which is cleaner. A score of 0 still shows on the sidebar; a reset score doesn't.


reasoning: Use 'team list' to see all existing teams. No arguments needed.

error: The command is 'team', not 'teams'. Minecraft commands are singular.


user_message: give all players except Steve and Alex a cookie

reasoning: Minecraft selectors don't support multiple name exclusions in one selector. Need to use tags: tag everyone, remove tags from excluded, then target by tag. Or use two separate name exclusions -- but @a[name=!Steve,name=!Alex] works by chaining exclusions.

commands: give @a[name=!Steve,name=!Alex] minecraft:cookie 1

commands: give @a[name!=Steve,name!=Alex] minecraft:cookie 1

error: '!=' is not valid selector syntax. Use 'name=!Steve' (exclamation before value, not before equals).


user_message: scatter all players randomly within 50 blocks

reasoning: Use spreadplayers to randomly distribute players. Syntax: spreadplayers <center> <spreadDistance> <maxRange> <respectTeams> <targets>. spreadDistance is minimum distance between players.

error: spreadplayers takes only x z for center (no y coordinate). The game automatically finds a safe y. Correct: spreadplayers <x> <z> <spread> <range> <respectTeams> <targets>.


reasoning: Use the 'health' criterion to track player health. Display below name so it shows under nametags as hearts.

commands: scoreboard objectives add hp health "HP"

commands: scoreboard objectives setdisplay belowName hp

commands: scoreboard objectives setdisplay belowName hp

error: Using 'dummy' criterion won't auto-track health. Use the 'health' criterion to automatically reflect each player's current health.


reasoning: Use 'scoreboard objectives setdisplay list kills' to show the kills objective in the player list (tab menu).

commands: scoreboard objectives setdisplay list kills

commands: scoreboard objectives setdisplay tab kills

error: 'tab' is not a valid display slot. The correct slot name is 'list' (for the player list/tab menu).


user_message: give everyone within 10 blocks of Steve a diamond

reasoning: Use 'execute at Steve' to set position context to Steve's location, then give @a[distance=..10] to select players within 10 blocks of that position.

commands: execute at Steve run give @a[distance=..10] minecraft:diamond 1

commands: give @a[distance=..10] minecraft:diamond 1

error: Without 'execute at Steve', the distance is calculated from the command source, not from Steve. Must set position context first.


reasoning: Use 'team modify red collisionRule always' to enable entity collision. Options: always, never, pushOtherTeams, pushOwnTeam.

error: 'collision' is not a valid team option. The correct option is 'collisionRule' with values: always, never, pushOtherTeams, pushOwnTeam.


reasoning: Use 'bossbar set <id> value' and 'bossbar set <id> max' to control the fill percentage. Set max to 100 and value to 50 for 50%.

commands: bossbar set minecraft:game_timer max 100

commands: bossbar set minecraft:game_timer value 50

error: Bossbar doesn't accept percentage directly. Set 'max' and 'value' separately. For 50%, use max=100, value=50.


reasoning: Use 'clear @a' to remove all items from every player's inventory. This is destructive -- players lose all items.

error: 'clear' without a target when run via execute may not work as expected. Use 'clear @a' directly which is cleaner.


reasoning: There's no single 'remove all tags' command. Use 'tag <player> list' to see tags, then 'tag <player> remove <tag>' for each. For a quick clear, remove known tags individually.

error: Wildcard '*' is not supported in tag remove. Must remove each tag individually by name. Use 'tag <player> list' first to see all tags.


reasoning: Simple tp command: tp <source> <target> teleports the source player to the target player's location.

error: Arguments are reversed. 'tp Steve slingshooter08' teleports Steve to slingshooter08, not the other way around. Correct: tp <who_moves> <destination>.


user_message: put everyone in adventure mode except me

reasoning: Use @a[name=!slingshooter08] to exclude the requester, then gamemode adventure to set their game mode.

error: This sets ALL players to adventure mode including the requester. Use @a[name=!slingshooter08] to exclude them.


user_message: make a scoreboard that tracks distance walked

reasoning: Use the custom statistic 'minecraft.custom:minecraft.walk_one_cm' to track walking distance. Display on sidebar. The value is in centimeters.

commands: scoreboard objectives add walked minecraft.custom:minecraft.walk_one_cm "Distance Walked"

commands: scoreboard objectives setdisplay sidebar walked

commands: scoreboard objectives add walked dummy "Distance Walked"

error: Using 'dummy' criterion requires manual updates. Use 'minecraft.custom:minecraft.walk_one_cm' to automatically track walking distance.


reasoning: In 1.21, use component syntax for custom names: [custom_name='"text"']. The name must be a JSON text component.

commands: give @a minecraft:diamond[custom_name='"Prize Diamond"'] 1

commands: give @a minecraft:diamond{display:{Name:"Prize Diamond"}} 1

error: Old NBT display name format. In 1.21, use component syntax: minecraft:diamond[custom_name='"Prize Diamond"'].


user_message: teleport everyone who is in creative to spectator

reasoning: This is about changing gamemode, not teleporting. Use @a[gamemode=creative] to target creative players and set them to spectator.

error: This tries to teleport to a player named 'spectator'. Changing gamemode requires 'gamemode spectator', not 'tp'.


user_message: send a red message to all players saying game starts in 10 seconds

reasoning: Use tellraw for colored messages. JSON text component with color field for red text.

commands: tellraw @a {"text":"Game starts in 10 seconds!","color":"red","bold":true}

error: 'say' command does not support color codes. Use 'tellraw' with JSON text components for colored/formatted messages.


user_message: set the team prefix for red team to [RED]

reasoning: Use 'team modify red prefix' with a JSON text component to set the prefix displayed before team member names.

commands: team modify red prefix {"text":"[RED] ","color":"red"}

error: Team prefix requires a JSON text component, not a plain string. Use {"text":"[RED] ","color":"red"} format.


reasoning: Use 'scoreboard objectives remove' to delete an objective. This removes all scores associated with it.

error: 'delete' is not a valid subcommand. Use 'scoreboard objectives remove <objective>' to delete an objective.