Questions tagged [minecraft-commands]

Anything related to the usage of commands, command blocks, and functions in the Minecraft game series. Always use this tag together with the [minecraft-java-edition], [minecraft-bedrock-edition], or [minecraft-education-edition] tag. Include details about the issue you're having (e.g. commands, error messages, screenshots, etc) and what you've tried so far to solve it. If you're building a redstone device without commands, use [minecraft-redstone] instead.

Commands (sometimes also called "cheats", because they are not intended to be used in regular Survival gameplay) are advanced features activated by typing certain strings of text into chat, command blocks, or functions. They allow detecting and acting on almost every aspect of the world, from simply teleporting one player to another, to complex data packs that heavily modify the game's effective behaviour or even bring entire other games into Minecraft.

What to include in your question

If it's your first time asking a question, then please read this Arqade Meta FAQ post first: What to do before asking a minecraft-commands question?

Include details about the issue you encounter and what you've tried so far to solve the issue in your question. E.g., commands, function files, data pack folder structure, command block settings, error messages, screenshots showing the issue, and anything that can help potential answerers understand your question better.

If you want to ask for help with a command or function that does not work as you expected, please make sure to provide a "minimal reproducible example". For more information, please consult the Commands, Command block and Function articles of the Minecraft wiki.

Tag notes

Please use either , , or together with this tag, depending on which game you play. Not using a tag specifying the game and not mentioning this anywhere else in the question will cause it to get closed as "Needs details or clarity".

Please also use if your question is specific to using commands in functions.

Please only use together with this tag if you are really very sure that it is a question about both. Good examples can be found here.

5134 questions
6
votes
1 answer

How to disable command message in Minecraft?

How to disable this messages? (btw i have gamerule commandBlockOutput set to false)
YarkozeqYT
  • 61
  • 1
  • 2
3
votes
2 answers

I accidentally made a /kill @p command repeat. Can I fix it?

On my server, I accidentally used a command block to make /kill @p repeat over and over. I don't know the coordinate of the command block, and I don't have McEdit. I am using PuTTY to connect to the server. Is there any way I can disable the…
2
votes
0 answers

Minecraft 1.14: How to check if a player has a position with a specific y-axis within a circular x,z area

Pretty much it's a climbing game. The first person to reach a certain height within the game boundaries wins. It's multiplayer so there could be people outside of the game at the specific y-axis as well. I need a command that will detect a player…
2
votes
2 answers

Minecraft-Command to remove all dropped sandstone

As the title says. I am getting a lot of dropped sandstone that I would like to get killed, but I also have bamboo and minecarts that I don't want getting deleted. Is there any way to do this using command blocks? The /fill command will not work for…
Kai036
  • 131
  • 1
  • 3
2
votes
1 answer

I can't have more than one working command block in my Minecraft world

So in my creative Minecraft world, I was trying out commands in command blocks. Now redstone is not my thing, so I still don't entirely know how they work. I was putting some /teleport commands in there and going to different places around the…
muffin
  • 41
  • 1
  • 2
2
votes
1 answer

How to kill someone standing on a certain block

So I am building a minecraft parkour. In a certain level, people may not walk on the red wool. When they walk on it, they die. Can someone help with the code on my command block ? I have this right now : /execute @a [XYZ] ~ ~ ~ detect ~ ~-1 ~…
Weeklyshark18
  • 43
  • 2
  • 8
1
vote
1 answer

How to make a message show for everyone when closest player is on the correct team

I am making a custom map with my friend, and at one part, you have to get scanned. If you're on team green it should say "Scan completed," but if they're on team red, it shouldn't say anything. execute if entity @p[team=green] run say "Scan…
1
vote
0 answers

Can I use the chat function to activate command blocks?

Is it possible to use the chat function in Minecraft 1.17 to activate a command block, like what most servers do with /lobby?
1
vote
3 answers

How do I use command blocks to teleport multiple random players to specific spots?

I've never dabbled in command blocks before, but I'm slowly learning. I am making a murder mystery mini game. I have a ton of problems but the one I am stuck on now is I want to teleport all the remaining alive players to a table, and around the…
1
vote
1 answer

Minecraft, are more objectives or more fake players better?

I heard of two methods of using fake players and objectives Small amount of fake player and lots of objectives for example: #fakeplayer obj1, #fakeplayer obj2, #fakeplayer obj3, #fakeplayer obj4 etc Lots of fake players and a very small…
Joe
  • 131
  • 2
  • 9
1
vote
0 answers

How do you make a item in an item frame unable to be taken out?

I need to find out how to put something in an item frame but make it so I cant accidentally hit it out and have to put it back each time. How do you do this with commands in the version that bees came out?
user241605
1
vote
2 answers

In Minecraft can you use an array in a /fill command?

So I was trying to replace any stone or air in a 2x6x1 square in-front of me. This is the command I am using. /Fill 64 13 87 67 16 90 coal_ore 0 replace {stone air} I am just getting into understanding some of the commands in Minecraft. This is…
user244406
  • 11
  • 1
1
vote
1 answer

Are there commands that can give players permissions like "can open containers" or "can build/mine

I'm making an adventure map. One of the players is supposed to be the host and the other 3-5 Are meant to have limited permissions. The goal is to make command blocks so there's a self destructing button that makes a person host and spawns them in…
1
vote
1 answer

Can I print scoreboard value with leading 0's?

In C programming, I can print numbers with leading 0's like this: int scoreboard_value_example1 = 214; int scoreboard_value_example2 = 132424; printf("%05d, ",scoreboard_value_example1); printf("%09d",scoreboard_value_example2); // Output : 00214,…
m4ndeokyi
  • 23
  • 5
1
vote
0 answers

Direct xp from kills instead of drops

I'm trying to build a direct xp for kill command chain using the scoreboard commands to test for a score count and exchange it for xp instead of dropping orbs I'm using /scoreboard players test @a Kills 1 [1] and scoreboard players remove @a Kills 1…
Rottijtog
  • 11
  • 1
1
2 3 4