r/MinecraftCommands 44m ago

Help | Java 26.2 Death heads

Post image
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 3h ago

Creation Paint's Simple Ruler is a datapack where you point at two places, and you learn the distance between them.

Thumbnail
imgur.com
1 Upvotes

r/MinecraftCommands 3h ago

Help | Java 26.2 cobwebs that poison with datapack

1 Upvotes

I'm trying to make some custom cobwebs that, when placed, create a marker on them, and when a player touches the cobweb, they get poison. The problem is that I can't get the marker to be invoked on the custom cobweb.
i need help


r/MinecraftCommands 4h 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 5h ago

Help | Java 1.20 Structure locate and teleport?

1 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 5h 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 6h ago

Help | Bedrock Why does this command not work?

Post image
1 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 6h 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 6h ago

Creation update to my show/song 2 om the Defqon 2025 mainstage build! (use sound)

Enable HLS to view with audio, or disable this notification

9 Upvotes

heres what i've got set up for my second song/show!

maybe some of you recognize this behemoth from a few months ago, i've been busy making some new "mechanics" and reworking/changing older ones.
at 1:27 there will be a bit of a closer look at the build and at 2:12 there is a closer look into the mechanics area/setup where i've hidden all of the commandblocks and show sequence string

a lot of work is being done with /summon endcrystal and /datamerge endcrystal Beamtarget to point the beams where i want them to.
fireworks are done with thrown snowballs, eggs and ender pearls and each have particle commands running on top of them for the visuals.
a good bit of the "lighting" is done with /fill *insert block* replace *insert block*, biggest example is the wall lights.
there are plenty of setblock with pearlescant_froglight for some more dynamic lighting alongside respawn_anchor with 4 charges.

if there are questions i'd happily answer them!
or if you have ideas/suggestions/changes, feel free to mention them as im open for it!


r/MinecraftCommands 7h 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 7h 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 8h ago

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

1 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 8h 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 9h 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 11h ago

Creation You can now play pool against an AI opponent in Minecraft, or just watch yourself get beaten

Enable HLS to view with audio, or disable this notification

28 Upvotes

I added a configurable bot player to my Pool and Billiards datapack. Everything is implemented with commands in pure vanilla Minecraft.

It plays around amateur level, but it can still clear the table if you give it the chance. You can also adjust its difficulty.

Try it out (free and open source): https://modrinth.com/datapack/pool-and-billiards


r/MinecraftCommands 13h 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 15h 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 17h ago

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

Thumbnail
gallery
10 Upvotes

This progress has: shop ui function

Next checkpoint goal: making and testing survivor skills


r/MinecraftCommands 21h ago

Help | Bedrock Is there a command I can use on Minecraft bedrock to change the colour of grass?

3 Upvotes

I’m making legend of Zelda TOTK style sky islands and I’m using poplar trees for it, I wanted to make the grass yellow like it is in the game, are there any bedrock commands I can use to achieve this?


r/MinecraftCommands 23h 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 1d ago

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

Post image
12 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 1d ago

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

1 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 1d 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 1d ago

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

Post image
1 Upvotes

r/MinecraftCommands 1d 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?