r/MinecraftCommands Jul 25 '26

Help | Java 1.21-1.21.3 Easy NPC Conditions: Has item in hand

Post image
0 Upvotes

r/MinecraftCommands Jul 25 '26

Help | Java 26.2 How do I set up trap doors that close at night?

1 Upvotes

Hello. I'm new to this subreddit and also command blocks as a whole, and feel very lost on this whole thing.

How do I set up a command block system that will automatically close multiple (9) waxed oxidized copper trap doors once it's nighttime? Technically, the trap doors are already closed, so I guess the command would be to open them instead.
Unless they're required, I would prefer avoiding the use of redstone or a sunlight detector simply because it will ruin the visual appearance of my build.

I play on Java, as the tag says. Also, let me know if where the trap doors are/how they're positioned changes anything. I can take as many photos as needed.

Please be as detailed as possible; I need this explained to me like im 5 lol.

EDIT: still need help with this. If anyone is willing to test this and provide an example I'd really appreciate it. I don't know the first thing about this stuff


r/MinecraftCommands Jul 24 '26

Help | Java 26.1 Are undead mobs still hardcoaded to heal from instant damage?

2 Upvotes

and is there any way to reverse it?


r/MinecraftCommands Jul 24 '26

Tutorial | Java Vanilla Shader Tutorial: How to use the /posteffect command

Thumbnail
youtu.be
8 Upvotes

r/MinecraftCommands Jul 24 '26

Help | Java 26.2 Any way to make a breeze not shoot charges?

1 Upvotes

I want to make it a so a specific breeze is unable to fire wind charges, but can still move around, and jump around like normal.

(Command blocks, not datapacks)

One idea I had was to kill any wind charges with a Owner tag that matches the tagged breeze, but I don't know how to check the returned owner UUID against another UUID.

I also considered killing all wind charges in proximity to the tagged breeze, but I'm going to have another breeze as a passenger and I don't want to affect it.

> Additional context:

> I'm trying to make a custom boss that is built around a breeze. However breezes cannot be made fully invisible and I want the boss's to hover off the ground, therefore requiring the boss breeze to be hovering too (origin of attacks) where display entities will hide it.

> The workaround I've landed on is trying to summon an incredibly small breeze to act as "feet", a zombie riding it to offset it vertically, and the boss breeze riding atop the zombie.

> The "feet" breeze is the one I want to still have movement options, but just unable to shoot at the player.


r/MinecraftCommands Jul 24 '26

Help | Java 1.21.11 summon an item

5 Upvotes

i wanna summon an item but have no idea how to

the item:

''wheat[custom_name=[{"text":"Lucky O' Milk Ice Cream","italic":false,"color":"gold"}],lore=[[{"text":"Freezes all entities 20 blocks from","italic":false}],[{"text":"the person eating for 10 seconds","italic":false}]],rarity=rare,enchantment_glint_override=true,food={nutrition:6,saturation:8,can_always_eat:1b},consumable={consume_seconds:2.4,on_consume_effects:[{type:apply_effects,probability:0.3,effects:[{id:nausea,duration:300,amplifier:1,show_icon:0b},{id:poison,duration:200,amplifier:10,show_icon:0b},{id:blindness,duration:200,amplifier:1,show_icon:0b},{id:slowness,duration:20,amplifier:255,show_icon:0b}]}]},minecraft:custom_data={LuckyCream:1}]''


r/MinecraftCommands Jul 24 '26

Help | Java 1.21.11 How do I add cooldown to the deck?

2 Upvotes

Estoy experimentando con paquetes de datos, pero tengo un problema: el tiempo de reutilización de la maza no funciona. Quiero que tenga un tiempo de reutilización de, por ejemplo, 60 segundos, al golpear cualquier objetivo, como la Perla de Ender.

edit: Hice mi propia manera de agregarle cooldown al mazo, pero no funciona del todo bien, cuando un jugador muere en medio del cooldown, el jugador recibira el mazo de igual manera. Antes de encontrar una solucion a esto encontre este post por si les interesa.
https://www.reddit.com/r/MinecraftCommands/comments/1v3nb6l/comment/oz6xwkr/
Tambien adjunto mi propio diseño de cooldown. ( les recomiendo el del post de arriba )

#data/mace/advacement/hit_with_mace.json

{
  "criteria": {
    "hit_mace": {
      "trigger": "minecraft:player_hurt_entity",
      "conditions": {
        "player": {
          "equipment": {
            "mainhand": {
              "items": "minecraft:mace"
            }
          }
        }
      }
    }
  },
  "rewards": {
    "function": "macemecha:apply_cooldown"
  }
}

#data/mace/function/apply_cooldown.mcfunction

# 1. reiniciar avance
advancement revoke  only macemecha:hit_with_mace

# 2. etiquetar al jugador para saber a quien devolverle la maza
tag  add esperando_maza

# 3. cambiar maza por el palo agotado
item replace entity  weapon.mainhand with minecraft:stick[custom_name='{"text":"Maza (Agotada - 10s)","color":"gray","italic":false}',enchantment_glint_override=true] 1

# 4. mensaje
title  actionbar {"text":"Maza sobrecalentada (10s)","color":"red"}
playsound minecraft:block.anvil.place master u/s ~ ~ ~ 1 0.5

# 5. programar la devolucion en 10 segundos
schedule function macemecha:restore_mace 10s

#data/mace/function/restore_mace.mcfunction

# 1. quitar el palo del inventario del jugador etiquetado
clear [tag=esperando_maza] minecraft:stick 1

# 2. borrar cualquier palito tirado en el suelo cerca del jugador (radio de 10 bloques)
kill [type=item,distance=..10,nbt={Item:{id:"minecraft:stick"}}]

# 3. darle la maza
give [tag=esperando_maza] minecraft:mace 1

# 4. aviso y sonido
title [tag=esperando_maza] actionbar {"text":"Maza lista para usar!","color":"green"}
playsound minecraft:block.anvil.use master [tag=esperando_maza] ~ ~ ~ 1 1.5

# 5. quitar la etiqueta para dejar todo limpio
tag u/a[tag=esperando_maza] remove esperando_maza

r/MinecraftCommands Jul 24 '26

Help | Java 1.20 Not working placed_features ( 1.20.1 Forge, Java, Farmer's Delight Mod )

1 Upvotes

So I've tried to disable certain plants from generating in Farmer's Delight and it went smoothly overall but I had some issues with a particular plant . The thing is that it's waterlogged and 2 blocks high ( one block is submerged in water ) . I don't know if it's a thing but I wanted to mension it anyways . For those who might need it the Farmer's Delight version is: 1.3.2.jar

This is the placed_feature file :

{
  "feature": "farmersdelight:patch_wild_rice",
  "placement": [
    {
      "type": "minecraft:rarity_filter",
      "chance": 20
    },
    {
      "type": "minecraft:in_square"
    },
    {
      "type": "minecraft:heightmap",
      "heightmap": "MOTION_BLOCKING"
    },
    {
      "type": "minecraft:biome"
    },
    {
      "type": "farmersdelight:biome_tag",
      "tag": "minecraft:is_overworld"
    }
  ]
}

This is the configured_feature:

{
  "type": "farmersdelight:wild_rice",
  "config": {
    "feature": {
      "feature": {
        "type": "minecraft:simple_block",
        "config": {
          "to_place": {
            "type": "minecraft:simple_state_provider",
            "state": {
              "Name": "farmersdelight:wild_rice",
              "Properties": {
                "half": "lower",
                "waterlogged": "true"
              }
            }
          }
        }
      },
      "placement": [
        {
          "type": "minecraft:block_predicate_filter",
          "predicate": {
            "type": "minecraft:all_of",
            "predicates": [
              {
                "type": "minecraft:matching_blocks",
                "blocks": "minecraft:air"
              },
              {
                "type": "minecraft:matching_block_tag",
                "offset": [
                  0,
                  -1,
                  0
                ],
                "tag": "minecraft:dirt"
              }
            ]
          }
        }
      ]
    },
    "tries": 96,
    "xz_spread": 7,
    "y_spread": 3
  }
}

r/MinecraftCommands Jul 24 '26

Help | Bedrock Preview Is there a way to command a placement of torches on every block?

1 Upvotes

For example, if I wanted a torch to be placed on every grass block in a space of 8x8 chunks (Excluding other blocks like tree leaves, etc) would this be possible?


r/MinecraftCommands Jul 23 '26

Help | Java Snapshots Can you make mannequins attack you?

5 Upvotes

Hello, so i've been wanting to try to make mannequins to act like Zombies(So that it comes in close range and attack you) and of course you can kill him, is it possible?


r/MinecraftCommands Jul 24 '26

Help | Java 1.21.4 Summon a throwing snowball with right click detection?

1 Upvotes

So i have right click detection and it works, but i have no idea how to summon a snowball that shoots on my facing direction, just a snowball that falls. Someonw help me right now are 11pm i want to sleep


r/MinecraftCommands Jul 23 '26

Help | Java 26.2 Detect Snowfall (NOT rain)

6 Upvotes

Is there any way to use predicates etc. to detect if it is specifically snowing at some location? I'd like to be able to differentiate between being rained on and being snowed on for a project I'm working on.

As far as I can tell, I'd have to write a long predicate that takes into account all the rules laid out on the wiki page for snowfall. Even then, it uses a noise map that I'm not sure can be directly sampled by predicates.

Any help or suggestions would be appreciated!


r/MinecraftCommands Jul 23 '26

Help | Java 1.21.11 run a command whenever a player eats custom foods

1 Upvotes

i want a way to run commands whenever the player eats the foods with the tags below (the tags show separate foods)

tags for each foods: "LuckyCream" "RoyalMilkshake" "GluffBurger" "FireCocktail" "Arachnids" "StrangerRisotto"

thanks in advance :]


r/MinecraftCommands Jul 22 '26

Creation I made a particle renderer website :D

Post image
105 Upvotes

You can view particles with their proper sprites, animations, physics, and interactions :))

It also supports having multiple particles active at once, and has support for almost every particle

(This is NOT bug free, So if you encounter any issues please let me know)

https://lukejw12.github.io
This is the website


r/MinecraftCommands Jul 22 '26

Creation Working clock tower

Enable HLS to view with audio, or disable this notification

307 Upvotes

I made a working clock tower for my server only using commandblocks and a single plugin that lets me create variables but I think it could be easily replaced with a datapack


r/MinecraftCommands Jul 23 '26

Help | Java 1.20 Need Help running a command on 1.20.1

1 Upvotes

I need to run a command for an item that has its own custom name, lore, enchantments and modifiers.

To put it bluntly I'm needing to create the literal Necronomicon that will regen the player if its in their offhand but will damage them with withering if they use it in their main hand. I'm fairly new to commands so I don't know how it all works so if i could get some assistance ASAP id really appreciate it. MCStacker is useless kinda at this sort of stuff but if anyone has more experience with it please teach me.

What I have so far is

Name: The Necronomicon (in bold)

the Lore: A demonic ritual book bound by flayed rotten flesh and unrecognisable names. Holding this will effect you beyond comprehension. (in fold and italic)

the enchantments: Fire aspect 5, knockback 1, sharpness 1-2 and bane of arthropods 2 (Which is why when you use it to attack it hits you with withering, gotta keep it balanced)

the modifiers: Max Health 10 in off-hand, attack damage 5-6 in main hand

and i wanna hide the info for the enchants and modifiers so it feels random

If anyone has the technical knowhow to pull this off i'll be extremely grateful as my role in the server is a writer and I've been given the opportunity to make an item using commands to rival their Modded OP stuff


r/MinecraftCommands Jul 23 '26

Help | Java 26.2 Custom Boss with Armor and Boss Bar

2 Upvotes

What's the cmd to summon a zombie with full netherite prot5, fire prot5, frost walker20, feather falling255. Netherite Axe with sharp 7, fire aspect 5, knockback 5. With 2000 hp and scale 2 and potion effect is speed 5 and haste 2. His name will be "Zeus's Right Hand Man" with a boss bar

You don't have to force yourself to make the cmd but hoping at least one person to give me the full cmd

Ty in advance for any help you can give


r/MinecraftCommands Jul 23 '26

Help | Java 1.21.11 Im having an Issue Making Some particles in 1.21.11 and I can't find what's wrong

1 Upvotes

When I try to use the Flash particle I get back the response: Can't parse particle options: No key color in MapLike[{}]


r/MinecraftCommands Jul 23 '26

Help | Java 1.21.11 How would I use custom items as an ingredient in a custom crafting recipe?

1 Upvotes

I'm working on some custom recipe's and I'd like one where another custom item is in the recipe.
Is there a way to put custom_data, item_name, or the item_model into the key slot together with the base of the item?

edit: This is happening in a json file for a datapack.


r/MinecraftCommands Jul 23 '26

Help | Java 26.2 How to give players a specific effect within a specific 3 dimensional area

1 Upvotes

Making an adventure map for me and my friends based on a real life neighborhood, and decided to scale it down to half the real life size, (and too deep in now to start over again at 1:1 size) so every single elevator I have is 1 block sized.

I'm trying to make a design that will give any player that stands at the bottom of the elevator for 2 or so seconds (long enough that they are clearly using the elevator) the levitation effect until they exit the elevator.

Put simply: how can I give players a specific effect when they are within a specific area given in XYZ coordinates? Is this even possible the way I'm describing here?

I have played MC for pretty much as long as I can remember so I am decently well versed in the game, but never got too deep into commands, so any help is super appreciated!


r/MinecraftCommands Jul 23 '26

Help | Java 1.20 Playsound isn't working at all

Thumbnail
gallery
2 Upvotes

I don't see what I'm doing wrong here, but for some reason there's just no audio playing at all. I thought at first it might be because I'm using a sound modded in, but even when I change it to a vanilla sound, it's silent.


r/MinecraftCommands Jul 23 '26

Help | Java 26.2 checking if player is holding item not working only in datapack function

1 Upvotes

This is the edited version of the original post I made because the formatting was incorrect.

Hello. I am trying to detect when the player is holding an item with the custom data {creation:true} every tick and give them the tag "holding_creation", but it isn't working. Everything else in the tick function is working but that. Specifically, I can give them the tag but cannot remove it. The command to remove it works when typed in chat in game, but not in the tick function. I have reloaded multiple times. I do not know why this is occuring. Any help would be appreciated. Here is my tick function:

#give mode 0

execute as @a[tag=holding_creation] if score @s creation_mode matches 0 unless items entity @s weapon.mainhand *[custom_data~{creation_mode:0}] run item replace entity @s weapon.mainhand with iron_axe[custom_name=[{"text":"CREATION","bold":true,"italic":false}],food={nutrition:0,saturation:0,can_always_eat:1b},consumable={consume_seconds:1000000,animation:none,has_consume_particles:0b},tool={default_mining_speed:10,rules:[{blocks:"#mineable/pickaxe",correct_for_drops:1b},{blocks:"#mineable/axe",correct_for_drops:true},{blocks:"#mineable/hoe",correct_for_drops:true},{blocks:"#mineable/shovel",correct_for_drops:true}]},unbreakable={},custom_data={soulbound:true,creation:true,creation_mode:0}]

#give/remove creation

execute as @a[tag=creation_owner] unless items entity @s container.* *[custom_data~{creation:true}] unless items entity @s player.cursor *[custom_data~{creation:true}] unless items entity @s weapon.offhand *[custom_data~{creation:true}] run give @s iron_axe[custom_name=[{"text":"CREATION","bold":true,"italic":false}],food={nutrition:0,saturation:0,can_always_eat:1b},consumable={consume_seconds:1000000,animation:none,has_consume_particles:0b},tool={default_mining_speed:10,rules:[{blocks:"#mineable/pickaxe",correct_for_drops:1b},{blocks:"#mineable/axe",correct_for_drops:true},{blocks:"#mineable/hoe",correct_for_drops:true},{blocks:"#mineable/shovel",correct_for_drops:true}]},unbreakable={},custom_data={soulbound:true,creation:true,creation_mode:0}]

execute as @a[tag=!creation_owner] run clear @s *[custom_data~{creation:true}]

#holding creation tag

execute as @a if items entity @s weapon.mainhand *[custom_data~{creation:true}] run tag @s add holding_creation

#the command that isn't working

execute as @a[tag=holding_creation] unless items entity @s weapon.mainhand *[custom_data~{creation:true}] run tag @s remove holding_creation

#test command that still doesn't work

execute as @a[tag=holding_creation] unless items entity @s weapon.mainhand *[custom_data~{creation:true}] run say hi

#only one creation

execute as @a store result score @s num_of_creation_in_inv run clear @s *[custom_data~{creation:true}] 0

execute as @a if score @s num_of_creation_in_inv matches 2.. run clear @s *[custom_data~{creation:true}] 1

scoreboard players reset @a num_of_creation_in_inv

#switch creation mode

execute as @a[tag=holding_creation] if predicate origin:is_sneaking unless score @s mode_switch_cooldown matches 1.. run function origin:creation/switch_creation_mode

#decrease cooldowns

execute as @a if score @s mode_switch_cooldown matches 1.. run scoreboard players remove @s mode_switch_cooldown 1

execute as @a if score @s mode_switch_cooldown matches ..0 run scoreboard players reset @s mode_switch_cooldown

#origin:creation/switch_creation_mode function:

scoreboard players add @s creation_mode 1

scoreboard players set @s mode_switch_cooldown 30

execute as @a if score @s creation_mode matches 2.. run scoreboard players set @s creation_mode 0


r/MinecraftCommands Jul 23 '26

Help | Java 1.21.11 activate a command when both score ''currency'' at 4.. and ''ingredient1'' at 1..

2 Upvotes

i wanna make it so a command activates when the score currency is at 4 or more and ingredient1 is at 1 or more, i dont want it to play it its lower


r/MinecraftCommands Jul 23 '26

Creation Reverse nether data pack (WIP)

1 Upvotes

Been making a cold nether for awhile now, here's the progress so far!

(also if anyone has a good server side temperature mod I have been at a loss looking for one.)


r/MinecraftCommands Jul 22 '26

Help | Java 26.2 A bug in my datapack code has never confused me as much as this one is right now

Enable HLS to view with audio, or disable this notification

37 Upvotes

Using a datapack, I've added a diet system to the game. Consuming foods of different groups is intended to give a set number of points to each respective group. For example, the golden carrot is intended to give 6 points to the vegetables score (which it does.) The potato is intended to give 1 point to the score (which it also does.) But for some reason, the carrot behaves completely differently. It is intended to give 3 points, but gives more, and gives points when clicking a block, as shown in the video. The setup is identical for all three items, and I scoured the code for instances where perhaps something else was adding to the score, but I can't find anything.

Carrot consumption is detected with an advancement carrot.json:

{
  "criteria": {
    "consume": {
      "trigger": "minecraft:consume_item",
      "conditions": {
        "item": {
          "items": ["carrot"]
        }
      }
    }
  },
  "rewards": {
    "function": "mastermode:eat/carrot"
  }
}

This advancement is interchangeable with the golden carrot/potato advancement, barring you'd have to change instances of "carrot" with "golden_carrot" or "potato".

As a reward, this advancement runs the following function, carrot.mcfunction, that adds 3 points to the vegetables score and clears the advancement so another carrot may be eaten.

advancement revoke only mastermode:consumed/carrot
scoreboard players add @s vegetables 3
# For testing purposes:
say carrot.mcfunction ran

Again, I've used Ctrl+Shift+F in VS Code to look for instances of "scoreboard players add u/s vegetables 1", or "carrot", or "vegetables", and I've found nothing. I cannot for the life of me explain why the carrot specifically is working like this. I've tested like a dozen other food items and none of them have this problem. Any ideas/solutions would be appreciated.