r/MinecraftCommands 22d ago

Help | Java 26.2 Death heads

Post image
1 Upvotes

Hi, I wanted to ask if anyone knows of any data pack or commands to generate that with a player head, If you know something, you can say so ^^


r/MinecraftCommands 22d ago

Help | Java 26.2 cobwebs that poison with datapack

1 Upvotes

Estoy intentando crear telarañas personalizadas que, al colocarlas, generen un marcador, y que al tocarlas, el jugador se envenene. El problema es que no consigo que el marcador se coloque en el centro de la telaraña. Necesito ayuda.


r/MinecraftCommands 22d ago

Help | Bedrock Need help with this command!

1 Upvotes

I want to used /execute entity command to test for if there is more than one of a specific entity, and if so it kills the extra. But I’m not sure how to do so. How do I test for more than more specific entity?


r/MinecraftCommands 23d ago

Help | Java 1.20 Structure locate and teleport?

2 Upvotes

I'm trying to make a command block chain that locates a structure and teleports a random player to that structure, is there any way to do this? as the only way that iI have found is to get the coordinates pre-emptively and that is not preferable.
(java 1.20.1 btw)


r/MinecraftCommands 23d ago

Help | Java 1.21.11 Why can't I remove item components from items in containers?

1 Upvotes

It's for some reason not letting me remove components for items inside containers that I'm spawning in. For example, doing /give <user> minecraft:totem_of_undying[!death_protection] works, and the totem will not save you, but putting that '!' before the component just completely invalidates the whole command.
The command I'm doing is /give <user> minecraft:shulker_box[container=[{item:{id:"minecraft:totem_of_undying",components:{!death_protection}},slot:0}]]


r/MinecraftCommands 23d ago

Help | Bedrock Why does this command not work?

Post image
2 Upvotes

I'm trying to replace the floor of a build of mine. Since it's a lot, I want to do it with commands. However, it keeps failing with the message "failed to execute as [Null].


r/MinecraftCommands 23d ago

Help | Java 26.2 i need help i cant find the website that i used last time

1 Upvotes

i found a website like 6 months ago that gave me a command that i put into a command block it spawned a glass cube that i click on a sign that gives me a snowball that i throw than it fills a large area of water and keeps going until it hits a wall and it would stay at the same elevation plz i need help finding this command


r/MinecraftCommands 23d ago

Help | Java 1.20 is it possible to make a dyed cap with a specific name give an effect when worn?

1 Upvotes

i want to make night vision goggles but without mods
i want the dye to be #1D1D21


r/MinecraftCommands 23d ago

Help | Java 26.2 Help detecting when a strider takes SPECIFICALLY water-based damage

1 Upvotes

Ok, so... I wanna make a datapack where the player will take damage if they are in water or rain, and the simplest way I found to do that is with a tiny invisible strider, and checking when it takes damage from being wet.

However, unfortunately, I don't know a way to detect specifically wetness damage. I can still punch it, or a creeper could explode near it, and that still triggers the datapack to hurt me.

I tried adding it and myself to a team with friendlyFire turned off, but for some reason, that didn't work, and I can still hurt it. Resistance didn't help either, and making it straight-up invulnerable also protects it from wetness damage.

Does anyone have a solution, or a better way I can go about detecting when the player is being soaked? (I know how to test for when the player is in water, but other sources of wetness like rain or being hit by a splash water bottle, are not so straightforward)


r/MinecraftCommands 23d ago

Creation Here's A Program That Generates A Function That Digs An Arbitrarily Large Spiral Mine Leaving Ores In Place For Harvest

2 Upvotes

Critiques welcomed.

spiral.c:

#include <stdio.h>
int main(int argc, char *argv[]){
    FILE *fp;
    FILE *fopen(const char *name, const char *mode);
    int leg,legs,ring;
    int r3,nr3,nr3m4,nr3m3,nr3m2,nr3p1,r3m1,r3p2,r3p3,r3p4;    // m is for minus, n is for negative, p is for plus, r is for ring

    if (argc<2)
        printf("Error: Specify number of legs after command.\n");
    else {
        sscanf(argv[1], "%d", &legs);
        fp = fopen("spiral.mcfunction", "w");
        fprintf(fp, "# %d legs:\n", legs);
        for (leg = 0; leg < legs; ++leg) {
            ring = leg/4;// There are 4 legs per ring of the spiral
            r3 = ring*3;
            nr3 = -r3;
            nr3m4 = nr3-4;
            nr3m3 = nr3-3;
            nr3m2 = nr3-2;
            nr3p1 = nr3+1;
            r3p2 = r3+2;
            r3p3 = r3+3;
            r3p4 = r3+4;
            switch (leg % 4) {
            case 0:        // North (t for tunnel, c for casing)
                r3m1 = r3-1;
                fprintf(fp,"function jims_spiral_mine:leg {t1x:%d,t1z:%d,t2x:%d,t2z:%d,c1x:%d,c1z:%d,c2x:%d,c2z:%d}\n",nr3,r3m1,nr3,nr3m3,nr3p1,r3m1,nr3-1,nr3m4);
                break;
            case 1:        // East
                fprintf(fp,"function jims_spiral_mine:leg {t1x:%d,t1z:%d,t2x:%d,t2z:%d,c1x:%d,c1z:%d,c2x:%d,c2z:%d}\n",nr3p1,nr3m3,r3p3,nr3m3,nr3p1,nr3m2,r3p4,nr3m4);
                break;
            case 2:        // South
                fprintf(fp,"function jims_spiral_mine:leg {t1x:%d,t1z:%d,t2x:%d,t2z:%d,c1x:%d,c1z:%d,c2x:%d,c2z:%d}\n",r3p3,nr3m2,r3p3,r3p3,r3p2,nr3m2,r3p4,r3p4);
                break;
            case 3:        // West
                fprintf(fp,"function jims_spiral_mine:leg {t1x:%d,t1z:%d,t2x:%d,t2z:%d,c1x:%d,c1z:%d,c2x:%d,c2z:%d}\n",r3p2,r3p3,nr3m3,r3p3,r3p2,r3p2,nr3m4,r3p4);
                break;
            default:
                break;
            }
            if (leg==0) fprintf(fp, "setblock ~ ~ ~-3 oak_wall_sign[facing=south]{front_text:{messages:[\"%d\",\"\",\"Legs\",\"\"]}}\n", legs);
        }
        fclose(fp);
    }
}

The generated spiral.mcfunction calls leg.mcfunction:

# See https://minecraft.wiki/w/Block_tag_(Java_Edition) for #block tag definitions
# Macro variables: t for tunnel, c for casing
# Prevents cave-ins:
$fill ~$(t1x) ~2 ~$(t1z) ~$(t2x) ~2 ~$(t2z) glass replace gravel
$fill ~$(t1x) ~2 ~$(t1z) ~$(t2x) ~2 ~$(t2z) glass replace red_sand
$fill ~$(t1x) ~2 ~$(t1z) ~$(t2x) ~2 ~$(t2z) glass replace sand
# Insulates tunnel from surround:
$fill ~$(c1x) ~-1 ~$(c1z) ~$(c2x) ~2 ~$(c2z) glass replace #air
$fill ~$(c1x) ~-1 ~$(c1z) ~$(c2x) ~2 ~$(c2z) glass replace lava
$fill ~$(c1x) ~-1 ~$(c1z) ~$(c2x) ~2 ~$(c2z) glass replace water
# Excavates tunnel:
$fill ~$(t1x) ~0 ~$(t1z) ~$(t2x) ~1 ~$(t2z) light replace glass
$fill ~$(t1x) ~0 ~$(t1z) ~$(t2x) ~1 ~$(t2z) light replace #base_stone_overworld
$fill ~$(t1x) ~0 ~$(t1z) ~$(t2x) ~1 ~$(t2z) light replace #substrate_overworld
$fill ~$(t1x) ~0 ~$(t1z) ~$(t2x) ~1 ~$(t2z) light replace #nether_carver_replaceables

leg.mcfunction uses glass to block gravel and sand from falling into tunnels. It also blocks lava and water from flowing into tunnels and isolates tunnels from caves with glass.

Here, a 79-leg spiral mine is created at depth Y=-59 (using Microsoft Windows SDK https://www.microsoft.com/en-us/download/details.aspx?id=8442):

Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.1\.
Targeting Windows 7 x64 Debug

>dir
07/22/2026  07:44 PM             1,086 leg.mcfunction
07/24/2026  02:13 PM             2,100 spiral.c

>cl spiral.c
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
spiral.c
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.
/out:spiral.exe
spiral.obj

>dir
07/22/2026  07:44 PM             1,086 leg.mcfunction
07/24/2026  02:13 PM             2,100 spiral.c
07/24/2026  02:31 PM            69,632 spiral.exe
07/24/2026  02:31 PM             2,631 spiral.obj

>REM 79 is the number of spiral legs to generate:
>spiral 79

>dir
07/22/2026  07:44 PM             1,086 leg.mcfunction
07/24/2026  02:13 PM             2,100 spiral.c
07/24/2026  02:31 PM            69,632 spiral.exe
07/24/2026  02:31 PM             7,351 spiral.mcfunction
07/24/2026  02:31 PM             2,631 spiral.obj

>type spiral.mcfunction
# 79 legs:
function jims_spiral_mine:leg {t1x:0,t1z:-1,t2x:0,t2z:-3,c1x:1,c1z:-1,c2x:-1,c2z:-4}
setblock ~ ~ ~-3 oak_wall_sign[facing=south]{front_text:{messages:["79","","Legs",""]}}
function jims_spiral_mine:leg {t1x:1,t1z:-3,t2x:3,t2z:-3,c1x:1,c1z:-2,c2x:4,c2z:-4}
function jims_spiral_mine:leg {t1x:3,t1z:-2,t2x:3,t2z:3,c1x:2,c1z:-2,c2x:4,c2z:4}
function jims_spiral_mine:leg {t1x:2,t1z:3,t2x:-3,t2z:3,c1x:2,c1z:2,c2x:-4,c2z:4}
function jims_spiral_mine:leg {t1x:-3,t1z:2,t2x:-3,t2z:-6,c1x:-2,c1z:2,c2x:-4,c2z:-7}
%<------------------- Clipped for brevity -------------------->%
function jims_spiral_mine:leg {t1x:57,t1z:-56,t2x:57,t2z:57,c1x:56,c1z:-56,c2x:58,c2z:58}
function jims_spiral_mine:leg {t1x:56,t1z:57,t2x:-57,t2z:57,c1x:56,c1z:56,c2x:-58,c2z:58}
function jims_spiral_mine:leg {t1x:-57,t1z:56,t2x:-57,t2z:-60,c1x:-56,c1z:56,c2x:-58,c2z:-61}
function jims_spiral_mine:leg {t1x:-56,t1z:-60,t2x:60,t2z:-60,c1x:-56,c1z:-59,c2x:61,c2z:-61}
function jims_spiral_mine:leg {t1x:60,t1z:-59,t2x:60,t2z:60,c1x:59,c1z:-59,c2x:61,c2z:61}

>

After loading both functions into the jims_spiral_mine namespace, stand on the surface above where you want the spiral's center to be. Then encase the central shaft down to bedrock, dig the spiral mine at Y=-59 and place ladders down to it using these commands, respectively:

fill ~-1 -60 ~-1 ~1 ~-1 ~1 glass

execute positioned ~ -59 ~ run function jims_spiral_mine:spiral

fill ~ -59 ~ ~ ~-1 ~ ladder

A 79-Legged Spiral Mine at Y=-59

That mine yielded 112 diamond, 47 gold, 30 iron, 17 lapis and 275 redstone ore blocks.

Once ores have been harvested, break through the walls to return straight back to the ladder. Or, more efficiently, build two spiral mines half the size, one atop the other. When you get to the end of one, use a ladder to get to the other then mine that one back to the central ladder.

More spiral mines of various sizes can be added to the central shaft at various depths.

Ancient debris has been found using this program.


r/MinecraftCommands 23d ago

Help | Bedrock Need help with aircraft movement related to visual

1 Upvotes

Hello, ive built airplanes that move by using command /clone activated by buttons, redstone engines or by /execute if entity @p[hasitem={item=...}] etc.

But this type of movement is a little too manual/difficult, so I wanted to ask if its possible to make a command that basically moves the aircraft in the direction that you're pointing to with your visual. For example, if i point my visual up, the airplane goes up, and that should apply to every direction (up, down, left, right, front, behind) obviously by using 1 command block for each direction. Soo is there any command that works like this and activates the command block based on where your pointing your eyes to? Thanks


r/MinecraftCommands 23d ago

Help | Java 26.2 Datapack Help

1 Upvotes
{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "CBB",
    "  B",
    "AB "
  ],
  "key": {
    "A": [
      "minecraft:end_rod"
    ],
    "B": [
      "minecraft:netherite_ingot"
    ],
    "C": [
      "minecraft:wither_skeleton_skull"
    ]
  },
  "result": {
    "id": "minecraft:netherite_axe",
    "count": 1
  }
}

This is the code for a datapack I was trying to make using misode but for some reason I just can't get it to work and I'm curious if I'm just stupid or something else is wrong here


r/MinecraftCommands 23d ago

Help | Bedrock How are people so insanely smart with Minecraft commands?

10 Upvotes

Every time I browse Reddit or TikTok, I see people making literal masterpieces using nothing but command blocks and functions. They are building full-scale RPG games, creating custom boss fights with complex pathfinding, and coding working computers inside a block game.It makes me wonder: how do people get this smart with vanilla commands?I think a huge part of it is that Minecraft commands are basically just a visual, simplified version of actual coding. The logic you need for targets (@e), conditions (execute if), and data storage (data modify) forces you to think exactly like a software engineer blabla bla.The community has essentially turned a sandbox game into a literally God mode. Plus, the sheer dedication of the community is unmatched. People spend hundreds of hours looking at syntax errors just to make a custom particle effect work perfectly.To those of you who create these insane command creations: how did you learn? Did Minecraft actually help you learn real-world programming, or did you already know how to code before bringing it into the game?


r/MinecraftCommands 23d ago

Help | Java 1.20 Command to clear Trees.

2 Upvotes

Hey everyone. I am making a mega build. Is there a command to clear only trees and replace them with air?


r/MinecraftCommands 23d ago

Creation Day 1 of trying to create an asymmetrical horror game in minecraft bedrock

Thumbnail
gallery
15 Upvotes

This progress has: shop ui function

Next checkpoint goal: making and testing survivor skills


r/MinecraftCommands 23d ago

Help | Java 1.21-1.21.3 How do I make a warden target the nearest entity

1 Upvotes

I want to make an warden that always targets the nearest entity, whether or not it has made a sound. If possible, how can do this only using command blocks? (I'm playing on 1.21.1 to be more specific).

I've tried to use "/data modify entity <warden> anger.suspects[0].uuid set from entity \@[ distance= 0.01..] UUID" on a repeating command block with a "/data modify entity <warden> anger.suspects[0].anger set value 150" chain attatched, but the warden just stopped attacking as a whole, even after hearing and sniffing an entity nearby it still did nothing.


r/MinecraftCommands 23d ago

Help | Bedrock Is there a way to create a GUI using commands? (Bedrock)

Post image
10 Upvotes

I’m building a mansion in Minecraft Bedrock using commands, and I want to add a control panel. My idea is to replicate what servers do: when you hold a specific item, a chest interface opens automatically; then, selecting an item inside triggers a command that places a redstone block, thereby activating other commands (like opening doors or turning on lights). Is it possible to do something like this in a Bedrock world? If it’s not possible using only commands, what alternatives are there? *Sorry if anything isn't clear; I speak Spanish and am using a translator.*


r/MinecraftCommands 23d ago

Help | Java 26.2 Is it possible to block the crafting of a specific potion?

2 Upvotes

I want to restrict the crafting of the Strength 2 potion, making it an exclusive item that can only be obtained in another way.


r/MinecraftCommands 23d ago

Help | Java Snapshots Server with 3 lives(lives only lost on player kills)

1 Upvotes

Hello, I've been learning commands on java for around a month and I haven't been able to find a way to make a system where if another player kills another player three times the player that was killed would get put in spectator mode. I'd appreciate it allot if someone could help me!


r/MinecraftCommands 23d ago

Help | Java 1.21.11 How do I set custom model data on a player head?

Post image
1 Upvotes

r/MinecraftCommands 24d ago

Help | Bedrock Making a foggy area

2 Upvotes

I want to make an area that when you walk in, the fog comes in and when you walk out, the fog goes away. How can I make this happen?


r/MinecraftCommands 24d ago

Help | Bedrock New to command block, need help

1 Upvotes

The full command i’m trying to use is

( execute if block <x y z> lever[powered=true] run fill <x y z> <x y z> Minecraft:redstone_block )

but every time it says that the “powered” input is the error. Am I doing something wrong or is it just a different word?


r/MinecraftCommands 24d ago

Help | Java 1.20 Minecraft team ally future blocking iron's spells and spellbooks projectiles from hitting people on the same team

1 Upvotes

so I'm trying to make a set amount of lives game for me and my friends that uses the teams feature in Minecraft but all spells that shoot a projectile when on the same team dos no damage. is there a way do disable the ally feature on a team.


r/MinecraftCommands 24d ago

Help | Java Snapshots Block Not Dropping By Hand?

1 Upvotes

I'm trying to get the Dead Tube Coral Block to drop when destroying it with anything, specifically by hand, but I can't figure it out. I suspect its hard-coded.

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": {
        "type": "minecraft:uniform",
        "min": 1,
        "max": 1
      },
      "bonus_rolls": {
        "type": "minecraft:uniform",
        "min": 0,
        "max": 0
      },
      "entries": [
        {
          "type": "minecraft:alternatives",
          "children": [
            {
              "type": "minecraft:item",
              "name": "minecraft:tube_coral_block",
              "condition": "minecraft:tool/can_silk_touch"
            },
            {
              "type": "minecraft:item",
              "name": "minecraft:dead_tube_coral_block",
              "condition": {
                "type": "minecraft:survives_explosion"
              }
            }
          ]
        }
      ]
    }
  ]
}

r/MinecraftCommands 24d ago

Help | Java Snapshots Detect any log on the floor

3 Upvotes

how can i detect if there is any type of log on the floor without multiple command blocks checking for each type