Questions tagged [minecraft-commands]

For questions about the commands you can enter into chat with "/", run in commandblocks or run through functions (either through data packs or add-ons). Questions about minecraft and its commands in general are better suited for gaming.stackexchange.com, unless they relate strongly to programming.

Minecraft is a voxel-based sandbox game created by the Swedish company Mojang. It is the best selling game of all time. In September 2014 Mojang was bought by Microsoft.

Minecraft is currently available in three main Editions, both of which are actively maintained and updated with new features regularly:

  • Java Edition - the original game, playable on Windows, MacOS and Linux. As the name suggests, it is written in Java.
  • Bedrock Edition - Also known as "Windows 10 Edition", "Minecraft PE" (Pocket Edition) and a few other names, is the unified version that most current platforms can play on together: Windows 10/11, Android, iOS, various XBox and Playstation platforms, as well as the Nintendo Switch. It is coded in C++.
  • Education Edition - based on the Bedrock Edition, Education Edition is the special edition of Minecraft that has features for the use in the classroom. Because it's built on top of the Bedrock Edition, EE tends to be behind on updates.

There are a handful of legacy editions of the game that are not maintained anymore, like the Nintendo 3DS or the PSVita Editions.

The two main editions, due to being coded differently and in different languages, work fairly differently under the hood. As such it is important that questions asked about Minecraft commands state which edition and version, as the available commands and methods may vary wildly.


Minecraft has its own scripting language that grew and evolved through the years of its existence from simple administrative commands to an extensive and powerful tool set for the creation of custom content.

These commands can be issued in-game by prefacing a chat message with a /, in the console of a dedicated Minecraft server, putting them into a commandblock inside the world that is powered by redstone or even through special text files (function files) in data packs (Java) / add-ons (Bedrock).


What to include in your 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 / add-on 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.


Official website of the game: minecraft.net

Notice: Minecraft questions need a strong relation to programming (through the use of commands) to be asked on stackoverflow. Otherwise they are better suited for gaming.stackexchange.com.

52 questions
0
votes
1 answer

Execute command doesn't work - Minecraft 1.16.3

I'm making a map and I want every time a player walks on top of an orange terracotta block, the player receives levitation for 1 second. The problem is when I run the command, the game just does nothing, there is no output even with /gamerule…
0
votes
1 answer

Running a comand only once in a function

I'm making a small datapack and I have trouble with giving health boost on the player. Unlike other effects, having the command /effect give @a[level=100..199] minecraft:health_boost 60 0 true always active will keep resetting the life of the extra…
Alex
  • 21
  • 1
0
votes
1 answer

Minecraft 1.16.5 how to summon a falling block(hopper) rotated in any direction?

I'm trying to build a building in Minecraft 1.16.5 using commands, and I don't know how to summon a falling block rotated in any direction. The command what I'm using now : summon falling_block ~-1 ~50 ~12…
The Reaper
  • 1
  • 1
  • 4
0
votes
2 answers

Why does my minecraft location_check predicate not run?

I have followed several tutorials to the letter, and got the "player is_sprinting:true" predicate to work. So I know my fresh new datapack is working. There are no examples of location predicates anywhere. Videos, wiki, nothing. I go to a generator…
0
votes
1 answer

Name of the notation that goes like / [arg0|arg1]

I know there is a notation or convention that for example describes the usage of a command (in a shell for example). / [arg0|arg1] means the following is a right way of expressing/using the command: /TheNameOfTheCommand arg0 or…
0
votes
0 answers

Minecraft - Making mobs hostile to other mobs using command block

On our minecraft realm I am a necromancer. Using the /team command I control hostile mobs to attack other players. I was hoping to make a way to make my wither skeletons and vex attack other mobs. If anyone has any ideas to make this possible using…
0
votes
1 answer

How to execute if there's a certain block within a radius

I'm trying to figure out how to execute (for example /say hi) when there's Yellow Terracotta in a certain radius or field, however I can't figure out how to do it. Anyone knows?
user14675106
0
votes
1 answer

What colour format is used in command block commands?

I just started using command blocks in Minecraft and I'm stuck. I'm trying to make a custom firework rocket colour with this command. give @p minecraft:firework_rocket{ Fireworks:{ Flight:2, Explosions:[{ Type:1, …
Hukify
  • 161
  • 1
  • 2
  • 7
0
votes
1 answer

Teleport command in Minecraft data pack is ignoring parameters

I have this command that's supposed to teleport players when they reach a specific point on the x axis (regardless of y or z), for some reason it teleports everyone regardless of their position on the x axis Here's the command - execute at…
KCGD
  • 675
  • 6
  • 10
0
votes
1 answer

Execute command if player has bow with certain tag

I have these commands and I want it to only explode the arrow if the player has a bow with the "explode" tag. Here are the commands (courtesy of AntVenom) "*" Means that all blocks under it have that property [Repeat,*Unconditional,*Always…
talhoid
  • 61
  • 9
0
votes
1 answer

How to /fill with Armor Stands In 1.12.2

I am trying to make a lag machine schematic in 1.12.2, and instead of placing 10000 Armor Stands by hand, I was wondering if there was any way to /fill them or use something with World Edit to do the same thing. I looked all over google but could…
0
votes
1 answer

What is the syntax to finish off this /execute gamemode command? It's exactly like the Status Effect command that works

I can give a player a status effect when they enter a certain area and remove it when they leave no problem, but when I try to do the same thing with the game mode, nothing happens. In my mind these are the same thing. I can get the game mode to…
Gorm
  • 3
  • 3
0
votes
1 answer

How to detect if player is near specific x coordinates?

I would like to detect the player with a command block when he is near or at X coordinates so: /execute if entity @a positioned ~ ~2 ~ run say hello but it doesn't work. I also tried: /execute if entity…
0
votes
1 answer

Trigger command not working in sign as non-operator

I am creating a minigame in Minecraft 1.16.3 via a datapack and mcfunctions. I want to make command-signs that a player can click on to change settings. I use the Trigger-command to make it accessible to non-operator players. I also enabled the…
MindStudio
  • 706
  • 1
  • 4
  • 13
0
votes
1 answer

Vanilla Minecraft Commands - How do I count the amount of players in an objective?

I am making a Bow Spleef minigame in Minecraft and cannot figure out how to determine a winner when one player is left. What I need is an execute-command that can detect if only one player is left in the Lives objective, then run a command…