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

Can a Minecraft Command Block target selector search for a player in a specific 1-block location?

So far as I can tell, as of Java 1.15.2, there is no way to pinpoint a single block to check for a target, only at minimum a 2x2 area with [distance=..1]. distance=1, distance=0, distance=..0 all seem to do nothing at all. There used to be the (in…
Daniel Gast
  • 181
  • 13
0
votes
1 answer

MC Bedrock Edition: Line 1, Column 2 '}' missing or object member name

So I'm trying to mess around with the command blocks in Minecraft Bedrock Edition. In this I was trying to give a wooden sword a sharpness 32K and a unbreaking 1000 enchantment. The code I use is: give @p wooden_sword 1 0…
Venepskeuten
  • 69
  • 1
  • 12
0
votes
1 answer

Summon a mob on play at certain level

I have a Redstone timer to activate a command block. I've tried summon vindicator @p[l>9] but it doesn't work. I want to summon a vindicator at the player that's level 10 or higher within a 500 block radius but I have no idea how to do this. This is…
0
votes
0 answers

How to spawn mobs upon a players death

I've done a number of test and looked up a ton of videos and all I can find is making random saying happen in chat when a player dies. I'm trying to make a GTA style police system so I want 3 vindicators to spawn with the custom name Cop where a…
0
votes
2 answers

Is there anything using command blocks to check if an entity is greater than certain ranges of a command block?

I was wanting to run a command based off of when a player gets out of the range of a command block, or if they are within two ranges. For example, like this where when the player gets inside of the red range that then the player gets a command run…
0
votes
1 answer

Minecraft execute command isn't working at all

So i'm developing a datapack for Minecraft 1.15 and I want to add a feature where if a player puts a water bucket into their main-hand whilst inside the Nether, it'll "boil" and turn the water bucket into an empty bucket. execute if entity…
0
votes
1 answer

Minecraft tick.json not behaving properly

This is what is written in the datapack function: execute if entity @a[scores={InShopMenu=1,PlayerSlot=0}] run tp @a ~ ~ ~ -125 2.5 execute if entity @a[scores={InShopMenu=1,PlayerSlot=1}] run tp @a ~ ~ ~ -112 3 execute if entity…
nisse26a
  • 103
  • 4
0
votes
1 answer

I’m trying to make a lever that can only be placed on certain blocks

This is what I have now but I’ve tried multiple different things. I’m on The most recent Xbox bedrock edition. Give @p lever 1 0 {“can_place_on”;[“diamond_block”]}
0
votes
1 answer

If statement for vannila commandblocks in Minecraft

Just simply question... How do I check if player has a scoreboard point and if he have any, execute a command. Basically how to translate into command blocks something like this: scoreboard_check(): if @p has (x=! 0) in "scb": return…
0
votes
1 answer

How to make a command that only effects players in a certain gamemode

As of right now I have /gamemode adventure @a [r=40, name=!"contract to kil"] Which update other players gamemode but it continue to do so until lagging, I want it to exclude players already in adventure to prevent lag. I've tried…
user10107585
  • 17
  • 1
  • 4
0
votes
1 answer

How to check if one person is in gamemode 2 in minecraft 1.13 snapshots

I am coding a minecraft game in command blocks, which involves the last person standing being the winner. I have made it that once a player dies, they change into gamemode 3 automatically. I am using a scoreboard that counts deaths to switch the…
0
votes
1 answer

Command blocks to replace the functionality of /fill etc

Is there any way we can use command blocks to replace the functionality of /fill? for example if the user types /fill, he should be given a potato or something like that.
Anil Simon
  • 121
  • 1
  • 7
0
votes
1 answer

"Data tag parsing failed: Unbalanced curly brackets"

I've recently been trying to make a one command and have stumbled into this problem: [15:13:07] Data tag parsing failed: Unbalanced curly brackets {}: {Time:1,Block:repeating_command_block,Data:1,TileEntityData:{Command:/execute…
Pengus41
  • 1
  • 1
0
votes
1 answer

Is it possible to add two ClickEvents in one word in Minecraft

Now I have the following command, but these command does not work: /tellraw @p ["",{"text":"Click here","color":"aqua","clickEvent":{"action":"run_command","value":"/give @p diamond 2"},"clickEvent":{"action":"run_command","value":"/give @p diamond…
assholeaa
  • 3
  • 3
0
votes
2 answers

ComputerCraft Run Chat Command

I host a server and I was wondering: is there any way to run chat commands through ComputerCraft? I want to be able to run /tps through the ComputerCraft terminal and then have it print out the TPS. Help would be greatly appreciated. Thanks.
Lucas Baizer
  • 305
  • 2
  • 5
  • 13