user_message: send a fancy message showing a player's kill count

reasoning: Use tellraw with mixed text components: plain text, selector component for player name, and score component to display a scoreboard value.

commands: tellraw @a [{"text":"Player "},{"selector":"@p"},{"text":" has "},{"score":{"name":"@p","objective":"kills"}},{"text":" kills"}]

error: 'say' resolves @p to the player name but cannot display scoreboard scores. Use 'tellraw' with score component {"score":{"name":"@p","objective":"kills"}} to show scoreboard values.

difficulty: hard

extracted_from: advanced_commands_training, Minecraft 1.21 command reference


user_message: send a clickable message that runs a command when clicked

reasoning: Use tellraw with a clickEvent component. 'run_command' executes the command as the clicking player. 'suggest_command' puts it in their chat box.

commands: tellraw @a {"text":"[Click for a Diamond!]","color":"gold","clickEvent":{"action":"run_command","value":"/give @s minecraft:diamond 1"},"hoverEvent":{"action":"show_text","contents":"Click to receive a diamond!"}}

commands: tellraw @a {"text":"[Click for a Diamond!]","click":{"action":"run_command","value":"/give @s diamond 1"}}

error: Two errors: (1) Field is 'clickEvent' not 'click', (2) item ID needs minecraft: namespace prefix. Also missing hoverEvent for user feedback.


reasoning: Use tellraw with hoverEvent component. 'show_text' action displays text when the player hovers over the message.

commands: tellraw @a {"text":"Hover over me!","color":"green","hoverEvent":{"action":"show_text","contents":"This is the hover text!"}}

commands: tellraw @a {"text":"Hover over me!","hoverEvent":{"action":"show_text","value":"This is the hover text!"}}

error: In 1.21, hoverEvent uses 'contents' field, not 'value'. The 'value' field is deprecated.

difficulty: medium


reasoning: Use the 'loot give' command to generate random loot from a loot table and give it directly to a player. 'minecraft:chests/simple_dungeon' is the dungeon chest loot table.

commands: loot give slingshooter08 loot minecraft:chests/simple_dungeon

commands: give slingshooter08 minecraft:chest_loot 1

error: 'chest_loot' is not an item. Use 'loot give <player> loot <loot_table>' to generate random items from a loot table.


reasoning: Use 'place template' to spawn a structure from the built-in structure templates. Village houses are in the minecraft:village namespace.

commands: place template minecraft:village/plains/houses/plains_small_house_1 -50 65 -100

commands: structure load minecraft:village/plains/houses/plains_small_house_1 ~ ~ ~

error: 'structure load' is Bedrock Edition syntax. In Java 1.21, use 'place template <structure> <pos>' for placing structures.


reasoning: Use 'data get entity' to read a player's NBT data. This shows all stored data including inventory, position, health, etc.

error: 'query' is not a valid data subcommand. Use 'data get entity <player>' to read entity data.

difficulty: easy


reasoning: Use 'data modify entity @s Health set value 20.0f' to set health to max (20 = 10 hearts). The 'f' suffix indicates a float value.

commands: data modify entity slingshooter08 Health set value 20.0f

commands: data modify entity slingshooter08 Health set 20

error: Missing 'value' keyword and float suffix. Correct syntax: 'data modify entity <target> <path> set value <nbt_value>'. Health is a float, so use '20.0f'.


reasoning: Use the attribute command to set max_health. Default is 20 (10 hearts), so doubled is 40 (20 hearts). In 1.21, the attribute ID is minecraft:max_health.

commands: attribute slingshooter08 minecraft:max_health base set 40

commands: attribute slingshooter08 minecraft:generic.max_health base set 40

error: In 1.21, attribute IDs were renamed. 'generic.max_health' is now just 'max_health'. Use 'minecraft:max_health'.


user_message: set up a trigger objective for players to use

reasoning: Trigger objectives can be set by non-op players using '/trigger'. Create the objective with 'trigger' criterion, then enable it for players.

commands: scoreboard objectives add vote trigger "Vote"

commands: scoreboard objectives add vote dummy "Vote"

error: A 'dummy' objective cannot be used with '/trigger'. Must use the 'trigger' criterion so non-op players can set their score via '/trigger vote set <value>'.


reasoning: Use 'schedule function' with time in ticks (20 ticks = 1 second, so 5 seconds = 100t). The function must exist in a datapack.

commands: schedule function mypack:my_function 100t

error: Time unit 's' for seconds is valid in 1.21, but 't' for ticks is more precise. Both work: 5s = 100t. However, 'schedule' only runs datapack functions, not arbitrary commands.


reasoning: Use 'forceload add' to keep chunks permanently loaded even when no players are nearby. Takes chunk coordinates (block x/z divided by 16). For block 0,0 that's chunk 0,0.

error: forceload only takes x z coordinates (chunk columns), not x y z. There is no y component for chunk loading.


user_message: randomly spread all players in a 50 block radius

reasoning: Use spreadplayers: center x z, minimum spread distance between players, max range from center, respectTeams boolean, and targets.

error: Minimum spread distance of 0 means players could be placed on top of each other. Use at least 5-10 blocks for minimum spread.


user_message: copy the building from 0 0 0 to 10 10 10, paste it at 100 0 0

reasoning: Use 'clone' command: clone <begin> <end> <destination>. The source region is from 0 0 0 to 10 10 10, destination starts at 100 0 0.

error: Arguments reversed. Clone syntax is: clone <from_x y z> <to_x y z> <dest_x y z>. The first two coordinate sets define the source region, the third is the destination.


reasoning: Use the 'ride' command to mount the nearest horse entity. In 1.21, 'ride @s mount <target>' puts the executing player on the target entity.

commands: ride slingshooter08 mount @e[type=minecraft:horse,limit=1,sort=nearest]

commands: execute as slingshooter08 run mount @e[type=minecraft:horse,limit=1,sort=nearest]

error: 'mount' is not a command. Use 'ride <entity> mount <target>' to mount an entity.


reasoning: Use the 'damage' command to apply damage. Syntax: damage <target> <amount> <damageType>. Magic damage type is minecraft:magic.

commands: effect give slingshooter08 minecraft:instant_damage 1 0

error: instant_damage effect applies 3 hearts of damage at amplifier 0, not exactly 5. Use 'damage' command for precise damage amounts.


user_message: replace all dirt with stone in a 5 block radius under me

reasoning: Use 'fill' with 'replace' mode to swap specific blocks. Fill from ~-5 ~-1 ~-5 to ~5 ~-1 ~5 (the layer under the player) replacing dirt with stone.

commands: execute at slingshooter08 run fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:stone replace minecraft:dirt

commands: fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 stone replace dirt

error: Missing 'minecraft:' namespace prefix on both block IDs and missing 'execute at' for position context from console.


reasoning: Use 'setblock' with block state syntax to place a chest with specific facing direction. In 1.21, block states use [key=value] syntax.

commands: execute at slingshooter08 run setblock ~ ~1 ~ minecraft:chest[facing=north]

error: Numeric metadata values (like '2' for facing) are legacy syntax. In 1.21, use block state syntax: minecraft:chest[facing=north].


reasoning: Use 'locate structure' to find the nearest nether fortress. Must be in the nether or use 'execute in' for cross-dimension locate.

commands: execute in minecraft:the_nether run locate structure minecraft:fortress

error: Missing 'minecraft:' namespace prefix. Also, if the player is in the overworld, need 'execute in minecraft:the_nether' to search in the nether.


reasoning: Use 'locate biome' to find the nearest mushroom fields biome. The biome ID is minecraft:mushroom_fields.

error: 'mushroom_island' is the old biome name. In 1.21, it's 'minecraft:mushroom_fields'. Also needs namespace prefix.


reasoning: Simple 'seed' command returns the world seed. No arguments needed.

error: 'seed' is not a gamerule. It's a standalone command. Just use 'seed' with no arguments.


reasoning: Simple difficulty command. Valid values: peaceful, easy, normal, hard.

error: Numeric difficulty values are legacy. In 1.21, use the word: peaceful, easy, normal, or hard.


reasoning: Use 'setworldspawn' to set the default spawn point for all new players and respawning players without individual spawnpoints.

error: Without coordinates, setworldspawn uses the executing position. From console this would be 0 0 0. Specify explicit coordinates for accuracy.


reasoning: Use 'spawnpoint' to set an individual player's spawn. This overrides the world spawn for this player specifically.

error: 'setworldspawn' changes the spawn for ALL players and new joins. Use 'spawnpoint <player> <pos>' for individual player spawn points.


reasoning: Use 'execute in minecraft:the_nether run tp' to change dimension context then teleport. Nether coords are 1/8 of overworld, so divide x and z by 8 for correct placement.

commands: execute in minecraft:the_nether run tp slingshooter08 -6 65 -12

error: tp does not accept a dimension argument. Must use 'execute in <dimension> run tp' for cross-dimension teleportation.


reasoning: Use 'clone' with 'filtered' mode to only copy specific block types. Syntax: clone <from> <to> <dest> filtered <block>.

commands: clone 0 60 0 20 70 20 100 60 0 filtered minecraft:stone

commands: clone 0 60 0 20 70 20 100 60 0 replace minecraft:stone

error: 'replace' mode copies all blocks. Use 'filtered' mode to copy only the specified block type.


reasoning: Use the attribute command to modify movement_speed. Default is 0.1. Setting to 0.2 doubles walking speed permanently (until changed back).

commands: attribute slingshooter08 minecraft:movement_speed base set 0.2

commands: attribute slingshooter08 minecraft:generic.movement_speed base set 0.2

error: In 1.21, attribute IDs were simplified. 'generic.movement_speed' is now 'movement_speed'. Use 'minecraft:movement_speed'.


reasoning: Use 'fill' with 'hollow' mode to create a box with walls but air inside. This replaces the interior with air and builds the shell.

commands: execute at slingshooter08 run fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:glass hollow

commands: execute at slingshooter08 run fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:glass

error: Without 'hollow' mode, this creates a solid cube of glass. Use 'hollow' to make a box with air inside.


user_message: outline a box of stone without filling inside

reasoning: Use 'fill' with 'outline' mode. Unlike 'hollow' which replaces interior with air, 'outline' only places the outer shell and leaves the interior untouched.

commands: execute at slingshooter08 run fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:stone outline

commands: execute at slingshooter08 run fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:stone hollow

error: 'hollow' replaces the interior with air, which is destructive if there are blocks inside. Use 'outline' to only place the shell without modifying the interior.


reasoning: Use 'locate structure' to find the nearest village. In 1.21, village is a structure tag that includes all village variants.

error: In 1.21, 'locate' requires the 'structure' subcommand. Also, the structure ID needs the full name like 'minecraft:village_plains', not just 'village'.


reasoning: Use fill command with water. Fill from y-3 to y-1 (under the player) in a rectangular area. Water source blocks will fill the pool.

commands: execute at slingshooter08 run fill ~-5 ~-3 ~-5 ~5 ~-1 ~5 minecraft:water

commands: execute at slingshooter08 run fill ~-5 ~-3 ~-5 ~5 ~-1 ~5 minecraft:water_flowing

error: 'water_flowing' is not a valid block ID. Use 'minecraft:water' which places water source blocks.


reasoning: Use 'loot give' with the 'kill' source to simulate mob drops. The wither drops a nether star on death.

commands: loot give slingshooter08 kill @e[type=minecraft:wither,limit=1,sort=nearest]

commands: give slingshooter08 minecraft:nether_star 1

error: While this gives the expected drop, using 'loot give <player> loot minecraft:entities/wither' properly generates drops from the loot table, which may include random variations.


reasoning: Use 'ride dismount' to get off the current mount.

error: 'dismount' is not a standalone command. Use 'ride <player> dismount' to dismount from current vehicle/entity.


reasoning: Use setblock with relative coordinates. ~ ~-1 ~ is the block directly under the player's feet.

commands: execute at slingshooter08 run setblock ~ ~-1 ~ minecraft:bedrock

error: Missing 'minecraft:' namespace prefix. Use 'minecraft:bedrock'. Also, using 'execute at' with relative coords is more flexible than hardcoded coordinates.


reasoning: Use fill command to create a wall. Wall is thin in one dimension (z), wide in x, and tall in y. Use lava source blocks.

commands: execute at slingshooter08 run fill ~-5 ~ ~ ~5 ~5 ~ minecraft:lava

commands: execute at slingshooter08 run fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:lava

error: This creates a 10x5x10 CUBE of lava, not a wall. For a wall, one dimension should be 1 block thick (same z coordinate on both ends).


reasoning: Use 'data get entity' with a selector to read the creeper's NBT data including fuse time, explosion radius, etc.

commands: data get entity @e[type=minecraft:creeper,limit=1,sort=nearest]

error: Missing 'entity' keyword. Correct syntax: 'data get entity <target>'. The 'entity' source type must be specified.


reasoning: Use fill to create a 1x20x1 column. The fill area is 1 block in x and z, 20 blocks in y.

commands: execute at slingshooter08 run fill ~ ~ ~ ~ ~19 ~ minecraft:iron_block

commands: execute at slingshooter08 run fill ~ ~ ~ ~ ~20 ~ minecraft:iron_block

error: ~19 creates 20 blocks (from current to +19 inclusive). ~20 would create 21 blocks.


user_message: set difficulty to peaceful to clear all mobs then back to normal

reasoning: Switching to peaceful despawns all hostile mobs instantly. Then switch back to the desired difficulty. This is a common trick for quick mob clearing.

error: This kills ALL non-player entities including pets, villagers, item frames, etc. Switching to peaceful only removes hostile mobs and is much safer.


user_message: send a tellraw message that shows an item tooltip on hover

reasoning: Use hoverEvent with 'show_item' action to display an item tooltip when hovering over text.

commands: tellraw @a {"text":"[Diamond Sword]","hoverEvent":{"action":"show_item","value":"{id:diamond_sword}"}}

error: In 1.21, hoverEvent uses 'contents' not 'value', and the item needs proper format with 'id' and 'count' fields, plus minecraft: namespace.


user_message: replace all oak planks with spruce planks in the area

reasoning: Use fill with 'replace' mode to swap one block type for another. This is essentially a find-and-replace for blocks.

commands: execute at slingshooter08 run fill ~-15 ~-5 ~-15 ~15 ~10 ~15 minecraft:spruce_planks replace minecraft:oak_planks

commands: execute at slingshooter08 run fill ~-15 ~-5 ~-15 ~15 ~10 ~15 minecraft:spruce_planks

error: Without 'replace minecraft:oak_planks', this fills the ENTIRE area with spruce planks, destroying all other blocks. The replace mode only changes matching blocks.


reasoning: Use 'forceload add' with two coordinate pairs to load a range of chunks. Coordinates are block positions -- chunks are derived from them.

error: These are chunk coordinates, but forceload takes block coordinates. For chunk 0,0 use block 0,0. For a range, specify the block coordinate corners.


reasoning: Use 'forceload query' to list all currently forceloaded chunks.

error: 'list' is not a valid forceload subcommand. Use 'forceload query' to see all forceloaded chunks.


reasoning: Use 'execute in minecraft:the_end' to switch dimension, then tp to the obsidian platform (100 49 0) which is the safe end spawn.

commands: execute in minecraft:the_end run tp slingshooter08 100 49 0

error: tp does not accept dimension names. Use 'execute in minecraft:the_end run tp' for cross-dimension teleportation.


reasoning: In 1.21, signs use component format. Place the sign with setblock, then use data merge to set the text on the front.

commands: execute at slingshooter08 run setblock ~ ~1 ~ minecraft:oak_sign

commands: execute at slingshooter08 run data merge block ~ ~1 ~ {front_text:{messages:['"Line 1"','"Line 2"','"Line 3"','"Line 4"']}}

commands: setblock ~ ~1 ~ minecraft:oak_sign{Text1:"Line 1",Text2:"Line 2"}

error: Text1/Text2 format is legacy. In 1.21, signs use front_text.messages array with JSON text components.


reasoning: Use 'data get entity' to query the Pos field which contains exact x, y, z coordinates as doubles.

error: While tp shows coordinates in feedback, 'data get entity <player> Pos' directly returns the precise position data.


reasoning: Use 1.21 component syntax to create a stick with high knockback enchantment. Knockback 10 gives extreme knockback.

commands: give slingshooter08 minecraft:stick[enchantments={knockback:10}] 1

commands: give slingshooter08 minecraft:stick{Enchantments:[{id:knockback,lvl:10}]} 1

error: Old NBT Enchantments format. In 1.21, use component syntax: item[enchantments={name:level}].