The Meaning of Life, the Universe, and Everything.
Join Date:
9/17/2015
Posts:
475
Member Details
My Command Doesn't Work - FAQ!
Commands in Minecraft sometimes just don't want to work. Here are a few common problems:
(Read over the headlines and find what applies for you)
Does the command produce any error messages?
In most cases, the command block throws an error message when the command fails. There is no error message? Try to enter the command in chat. Or, if the command block contains a small button with an X, click on it and run the command block again.
The output comes with a timestamp. Compare it to the current time to see if the command has been running recently. (Note: On servers the timestamp might be off, consider time zones)
Here are a few error messages explained:
"Selector '@...' found nothing" > The submitted arguments can't find a matching entity. Read "Are you working with entity selectors"!
"Failed to execute '...' ad '...'" > The command behind execute is flawed. Try this command on it's own. (Note: This doesn't necessarily mean, no entity managed to execute the command)
"Unable to summon object" >
"Data tag parsing failed" > Issue in NBT. Read "Are you working with NBT"!
"Invalid json" > JSON can be extremely fragile. Read "Are you working with JSON"!
"Usage: ..." > Your command syntax is wrong. Check if you didn't switch two parts of the command. Make sure there are no spaces in objectives, names and selectors. Make sure there is only ever one space in between to arguments. This the place to look up command syntax: http://minecraft.gamepedia.com/Commands
"'...' is not a valid number" > Your command syntax is wrong. Read "Usage: ..."
"Unable to [...] out(side) of the world" > The given coordinates are in unloaded chunks or the Y value is not in range 0-255 for block changing commands.
Are you on a Bukkit/Spigot server or in a modded world?
Some plugins or mods (mostly "Essentials") overwrite Vanilla commands with their own commands.
In this case you have to prefix the command with "/minecraft:" to make sure you are accessing the vanilla command. For example:
"/tp @a ~ 4 ~" > "/minecraft:tp @a ~ 4 ~".
This is usually only the case for following commands: /tp, /kill, /give, /summon.
Is the command in a repeating command block or chain?
Try the following: Set the command block to 'Needs Redstone', click on 'Done'. Enter it again, set it to 'Always Active' and click on 'Done' again.
Are you working with entity selectors?
The entity with the given score, tag etc. might not exist. Try to use the selector with /say. "/say @e[...]". It this doesn't print names in chat, you have found your problem.
Check if you are in the right version. If you are in 1.10.2 or earlier, your entity names behind "type=" must start with a Capital letter.
If you are in 1.11 or newer, entity names are completely lowercase and seperated with underscores.
Check if there are blank spaces in the selector. Spaces won't work here.
Are you working with NBT?
If you are setting NBT or spawning en entity / tile entity with NBT, this doesn't matter, but if you test for it, you must use the exact NBT syntax.
Numers in NBT are saved in an data type, that needs to be added behind the number. For most this is "b", but for others it can be "s", "f", "d", or nothing. IDs however have to be prefixed with the correct namespace, for example id:"minecraft:stone" a
To find the correct value, execute the /entitydata or /blockdata command with empty curly brackets. For example "/entitydata @e[type=zombie,c=1] {}". This prints the current data in chat.
Are you working with JSON?
Everything in JSON needs to be enclosed in "quotation marks". The only exceptions are: Square and curly brachets, colons and commas, numbers and the values true and false. When there is a JSON construct inside another, every quotation mark has to be escaped. This means there need to be one ore more backslashes "\" in front of it. Since this is pretty hard, I recommend using generators such as minecraftjson.com.
- "How can I find the incorrect part" you may ask?
Look at the error message. It usually says "Invalid JSON: [...] at line 1, column #". Copy your command to Notepad ++. Delete everything that's not JSON. Start selecting the text word by word until you the value for "Sel: " in the bottom right reaches the number from the error message. Look a few characters before or after the current cursor position and find the error.
Are you using CommandStats?
Command stats (blocks or entities modified with the /stats command to return a number from a command into a scoreboard) only work when the score is already set to any value. Make sure you set the value of the score you want to modify to 0 first.
My Command Doesn't Work - FAQ!
Commands in Minecraft sometimes just don't want to work. Here are a few common problems:
(Read over the headlines and find what applies for you)
Does the command produce any error messages?
In most cases, the command block throws an error message when the command fails. There is no error message? Try to enter the command in chat. Or, if the command block contains a small button with an X, click on it and run the command block again.
The output comes with a timestamp. Compare it to the current time to see if the command has been running recently. (Note: On servers the timestamp might be off, consider time zones)
Here are a few error messages explained:
Are you on a Bukkit/Spigot server or in a modded world?
Some plugins or mods (mostly "Essentials") overwrite Vanilla commands with their own commands.
In this case you have to prefix the command with "/minecraft:" to make sure you are accessing the vanilla command. For example:
"/tp @a ~ 4 ~" > "/minecraft:tp @a ~ 4 ~".
This is usually only the case for following commands: /tp, /kill, /give, /summon.
Is the command in a repeating command block or chain?
There is a bug in the game where changing a powered command block to repeating doesn't make it start running. (https://bugs.mojang.com/browse/MC-86846")
Try the following: Set the command block to 'Needs Redstone', click on 'Done'. Enter it again, set it to 'Always Active' and click on 'Done' again.
Are you working with entity selectors?
The entity with the given score, tag etc. might not exist. Try to use the selector with /say. "/say @e[...]". It this doesn't print names in chat, you have found your problem.
Check if you are in the right version. If you are in 1.10.2 or earlier, your entity names behind "type=" must start with a Capital letter.
If you are in 1.11 or newer, entity names are completely lowercase and seperated with underscores.
Check if there are blank spaces in the selector. Spaces won't work here.
Are you working with NBT?
If you are setting NBT or spawning en entity / tile entity with NBT, this doesn't matter, but if you test for it, you must use the exact NBT syntax.
Numers in NBT are saved in an data type, that needs to be added behind the number. For most this is "b", but for others it can be "s", "f", "d", or nothing. IDs however have to be prefixed with the correct namespace, for example id:"minecraft:stone" a
To find the correct value, execute the /entitydata or /blockdata command with empty curly brackets. For example "/entitydata @e[type=zombie,c=1] {}". This prints the current data in chat.
Are you working with JSON?
Everything in JSON needs to be enclosed in "quotation marks". The only exceptions are: Square and curly brachets, colons and commas, numbers and the values true and false. When there is a JSON construct inside another, every quotation mark has to be escaped. This means there need to be one ore more backslashes "\" in front of it. Since this is pretty hard, I recommend using generators such as minecraftjson.com.
- "How can I find the incorrect part" you may ask?
Look at the error message. It usually says "Invalid JSON: [...] at line 1, column #". Copy your command to Notepad ++. Delete everything that's not JSON. Start selecting the text word by word until you the value for "Sel: " in the bottom right reaches the number from the error message. Look a few characters before or after the current cursor position and find the error.
Are you using CommandStats?
Command stats (blocks or entities modified with the /stats command to return a number from a command into a scoreboard) only work when the score is already set to any value. Make sure you set the value of the score you want to modify to 0 first.
My projects: https://blockbench.net/hub