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
3
votes
1 answer

How do I make a delay when using a .mcfunction file?

I'm trying to make a map like the new Among Us game pooping about but I'm running into a problem: I cant make a delay between commands. I tried on my own, but changed to looking up tutorials but their only for Minecraft Java Edition. I tried many…
Spooky
  • 81
  • 1
  • 6
2
votes
2 answers

How do I make my command work on minecraft?

I'm trying to make a Minecraft plugin that does /daytime. The plugin gets recognized by /pl, but if I execute the command it does not work. I tried modifying and moving the plugin.xml thinking Bukkit did not know where the main class was. package…
2
votes
1 answer

Minecraft: summon an item that can't be picked/grabbed by hoppers

I used the following command to summon items around a player for aesthetic purposes. (Minecraft: 1.16.5) execute as @e[name=Counting,type=minecraft:armor_stand,scores={Count=1}] run execute at @a[name=Name,gamemode=creative] run summon item ~0.75…
2
votes
1 answer

Executing a command if player is less than 10 blocks away

I'm trying to make an area that will only allow players to enter if they have 20+ ender dragon kills, so in order to prevent people from going in that area with less kills, I made an executing command that runs as an armor stand with the tag…
Alex
  • 21
  • 1
1
vote
1 answer

Minecraft execute if scoreboard value = 0 with command blocks

I want to make a command block that executes "say Zero pigs alive" when the amount of pigs on the map is zero. I made a pig count with a scoreboard on the side that shows the amount of pigs when I press on the button, but I want a command to be…
user14691343
1
vote
1 answer

Why won't my setblock command which summons a chest put the items inside I told it too?

So I am making a Minecraft command with /setblock. It is supposed to put a 32K diamond sword in the first slot, and a 32K diamond axe on the second slot. Here is my command (it's ver big): setblock ~ ~1 ~…
1
vote
1 answer

Minecraft PE(json) command

Why is this command not working? How can I fix it? I watched all the videos and none of them could explain. /give @p gold_ingot 1 0 {"display":[{Name:"help"}]}
0
votes
0 answers

Tick.mcfunction file spontaneously gets disabled. How to fix?

I was coding my first Minecraft data pack, and everything was working perfectly for the first bit. After some time of coding, the tick file seemed to entirely stop working. I checked in the tick.json file, and it looked exactly the same as the…
Korogue
  • 115
  • 6
0
votes
1 answer

Minecraft Command works in Console but not in a CommandBlock

So I've programmed a Plugin for Minecraft. Now I've tested the command in the console, it works totaly fine. But when I run the copy pasted command in a CommandBlock, nothing happends and the CommandBlock says: "Unexpected Error occurred trying to…
Sebi
  • 23
  • 5
0
votes
0 answers

My Kotlinplugin for Minecraft is not working

My Plugin for Fabric 1.19.3 makes an error when i perform a command in chat Here is the code for the command class package me.lukas.mcplugin1.commands import net.kyori.adventure.text.Component import…
0
votes
1 answer

Trying to make a circle in Minecraft using coordinates and Sin & Cos

I am trying to write a Minecraft Datapack, which will plot a full armorstand circle around whatever runs the particular command. I am using a 3rd party mathematics datapack to use Sin and Cos. However, when running the command, the resulting plot…
Accorwolf
  • 3
  • 1
0
votes
2 answers

Minecraft Commands - Recursive Functions

I am making a laser weapon that is basically a function that repeats itself across the 3D world, with each command being executed a block forward in relation to the previous command. However, I found it to be extremely overpowered and decided to…
hfanatic
  • 149
  • 1
  • 4
0
votes
1 answer

Minecraft 1.17.1 How to Summon a Falling Block: (piston[extended=true])?

I tried the following command: summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:piston",Properties:{extended:true}},Time:-1000,NoGravity:1b} but it wasn't the type of piston that I want to summon. Here is what I am looking for
WNG
  • 1
  • 2
0
votes
1 answer

The "tag=" nbt tag in minecraft selector

Very simple short and straightforward. I found that if I give myself firework_rockets with a custom tag called 'test', the item has an nbt={Tags:['test']}. The command I use is /give @s firework_rocket{Tags:['test']} 64 However once the firework is…
hfanatic
  • 149
  • 1
  • 4
0
votes
1 answer

execute command at entities around an arrow

as stated in the title I want to make a arrow that executes a command on all entities in a certain range of the arrow, the range I would like to be 10x10 from the center of the arrow. but I have not been able to get it working. execute as…
1
2 3 4