/r/MinecraftCommands

Photograph via snooOG

A place for all things about commands, command blocks and data-packs in vanilla Minecraft; to share, to question, to discuss, and more!

Please read the pinned post before posting.

Discuss, share, and ask questions about Minecraft commands and command blocks. Have fun and don't be afraid to ask questions!

Please read the pinned post before posting.

Feel free to join and ask questions on our community Discord server.

The links and pages on the subreddit wiki might help you.

If you have any questions or issues about the subreddit, you can contact the Moderators for assistance.

Rules of the subreddit:

  • No spamming comments, posts, or links.

  • Do not post inappropriate content.

  • Be respectful: Do not use offensive language, especially directed towards others.

  • Use common sense.

If you may fail to follow these rules on a constant basis, and ignore a moderator's warnings, you may be banned!

ENJOY!

This subreddit uses a custom version of /r/Naut.

You can follow the design development of the subreddit at /r/MCCDesign.

/r/MinecraftCommands

281,491 Subscribers

4

Can't think of a good strat to beat my friend 🤔

1 Comment
2024/11/01
05:39 UTC

1

How to detect if an entity is inside a solid (part of a) block

Let's say I have a very tiny armor stand, which has the scale attribute of 0.0625 and has {Small:1b,Invisible:1b} nbt tag.

I would like to see if I can detect whether this armor stand is inside of a solid (part of a) block.

It would be as easy as this:

execute as @n[type=minecraft:armor_stand,...} at @s unless block ~ ~ ~ #minecraft:air 

But actually this isn't so helpful, because, for example, if the armor stand is standing on a slab and not inside it, it would still return true.

So are there any alternatives? It would be okay if I had to use anything other than armor stand (e.g. falling block, item display, etc but not Ok for marker entity).

0 Comments
2024/11/01
05:41 UTC

2

We made halloween track for Mario Kart Project!

0 Comments
2024/11/01
04:20 UTC

3

Is it possible to have a record disc audio in /music follow your player where ever you go?

As far as I’ve tested, songs can only be played in specific locations, with the only way to move the music’s location is by restarting the song. I basically want the record disc audio to be attached to the player at all times. Is this possible? Any ideas appreciated, even if it’s a non-command solution

1 Comment
2024/11/01
03:06 UTC

1

hi im new but if u want a minecraft command for practice crystalpvp with zombie here you have the command, is for 1.20.4 + and it is with armor and totems :)

/summon zombie ~ ~ ~ {HandItems:[{id:"minecraft:totem_of_undying",count:99,components:{"minecraft:max_stack_size":99}},{id:"minecraft:totem_of_undying",count:99,components:{"minecraft:max_stack_size":99}},{}],ArmorItems:[{Count:1,id:netherite_boots,tag:{Enchantments:[{id:protection,lvl:4}]}},{Count:1,id:netherite_leggings,tag:{Enchantments:[{id:blastprotection,lvl:4}]}},{Count:1,id:netherite_chestplate,tag:{Enchantments:[{id:protection,lvl:4}]}},{Count:1,id:netherite_helmet,tag:{Enchantments:[{id:protection,lvl:4}]}}]}

0 Comments
2024/11/01
02:59 UTC

1

Can you make custom advancements w/ command blocks?

I have an idea to remake some games in Minecraft, specifically Zelda: Phantom Hourglass, but I don't want the player to have to use a separate datapack just to run the world as intended. Given that datapacks are essentially commands written like code, I thought there was a way to do as the title says to keep track of progress, but I can't find anything online. Any help, if this is even possible?

1 Comment
2024/11/01
02:55 UTC

4

I made a death note

its silly

/give @p compass[attribute_modifiers={modifiers:[{id:"entity_interaction_range",type:"entity_interaction_range",amount:999,operation:"add_value",slot:"mainhand"},{id:"attack_damage",type:"attack_damage",amount:999,operation:"add_value",slot:"mainhand"},{id:"block_interaction_range",type:"block_interaction_range",amount:-999,operation:"add_value",slot:"mainhand"}],show_in_tooltip:false},item_name='"Death Note"',item_model="minecraft:writable_book",enchantment_glint_override=true,lore=['[{"color":"dark_purple","italic":false,"text":"Left-click on any entity to "},{"color":"dark_gray","italic":true,"text":"END "},{"color":"dark_purple","italic":false,"text":"them."}]']] 1
4 Comments
2024/11/01
02:13 UTC

3

BIG NEW GLITCH

I don't know if this is well known or not, but giving an item with a special color not included in the base texture(Ie. potions, dyed armor, etc,) an item model, the new texture will have a tint of the same color that you gave the real item. Some stuff I made with this:

Finally, a Blood Sword!

I haven't heard about any cool new custom items, so I have to assume that I am the first person to share this bug online. Mojang is gonna patch it soon, so let's get our kicks in while we can.

The command for the Void Blade:

/give @p leather_horse_armor[item_model="minecraft:iron_sword",max_stack_size=1,lore=['[{"bold":false,"color":"gold","obfuscated":false,"text":"Unbounded by light, the "},{"bold":true,"color":"dark_gray","text":"Void"}]','{"bold":false,"color":"gold","obfuscated":false,"text":" reigns supreme."}'],attribute_modifiers={modifiers:[{id:"attack_damage",type:"attack_damage",amount:99999999,operation:"add_value",slot:"mainhand"}],show_in_tooltip:false},custom_name='[{"bold":true,"color":"black","obfuscated":true,"text":"A"},{"bold":false,"color":"gray","obfuscated":false,"text":"THE VOID BLADE"},{"bold":true,"color":"black","obfuscated":true,"text":"A"}]',dyed_color={rgb:0,show_in_tooltip:false}] 1
1 Comment
2024/11/01
02:11 UTC

1

Is there any way to walk an entity around using commands?

I want to walk some villagers around to specific places in a specific order, and preferably at a specific speed.

Worst case scenario, I would just have static entities, but I'd like motion.

0 Comments
2024/11/01
01:38 UTC

1

Test for everything but 256

So, I am making Black Clover and I am starting of with the mana part, I am doing this on my notes since I don't have access to minecraft right now. I just want to know how to test if someone doesn't match the criteria. This is the command:

repeating|unconditional|always active

-execute as @e[tag=!has_mana,tag=!member] at @s unless score @s hasmana matches 256 if score @s hasmana _____ run tag @s add has_mana

5 Comments
2024/11/01
01:23 UTC

1

Every-tick functions in datapacks aren't working

I'm trying to figure out how to run a mcfunction every tick. Internet search results from 2 or 3 years ago all yield the same result: create a file called tick.json in the function folder, and add this syntax:
{
"values":["namespace:function"]
}
However, this does not result in the function running automatically at all. I have run the function manually and it works as intended.
My file hierarchy is as follows:
pack.mcmeta
pack.png
data > namespace > function > function.mcfunction and tick.json
(Forgot this: I'm on version 1.21.3, using fabric but only with clientside mods)

2 Comments
2024/11/01
01:15 UTC

1

Custom structure says it generated but didn't

https://preview.redd.it/926es9a1t6yd1.png?width=854&format=png&auto=webp&s=2b3ed622bed810f1f0f955607e92bab7dc33cc5a

I made a custom dimension and a custom biome but the structures that are supposed to generate just don't generate even if i do /place.

4 Comments
2024/11/01
00:48 UTC

0

I am a noob at building in minecraft bedrock what are some cool builds I could build

g

2 Comments
2024/10/31
23:35 UTC

1

How to make creeper explosion do no damage to players or itemframes

I want to make a little mini game for me and my friends but for that i need a creeper as a visual effect exploding but not destroying anything or making any damage to anyone of my friends i dont even know how long i have been searching for it on google but i just dont know what to do anymore so im just asking here

4 Comments
2024/10/31
22:14 UTC

1

Item Detection Struggles

This is my first time on Reddit to ask for help.
So I want to create an item for a server that I am running amongst friends, but my command system
is not quite working.
Can you fellow command writers check it out for me, please?(ignore the '.' between @ and a/s)

give @.a player_head[profile={properties:[{value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWI3NmI0ZWU5ODg1NzIyOTdjYmQ4NzQ2ODNiZWU5NmFlM2M1NWNlOTRjMDA0ZTUxYWRjODJjZWUxNmNkMGIwYyJ9fX0=",name:textures}]},custom_name='["",{"text":"Loving Heart","italic":false,"color":"light_purple"}]',lore=['[""]','["",{"text":"When in Inventory:","italic":false,"color":"gray"}]','["",{"text":"+2 Max Health","italic":false,"color":"blue"}]'],custom_data={LovingHeart:1}]

w/

execute if entity @.a[nbt={Inventory:[{id:"minecraft:player_head",components:{"minecraft:custom_data":{LovingHeart:1}}}]}] run effect give @.s health_boost infinite 0 false

Thanks once again.

4 Comments
2024/10/31
21:33 UTC

3

How to hide the Color text on leather armor

I have a dyed piece of armor, and under the name of the item, it says “Color: #(color code)” I tried using hide_additional_tooltips, but that didn’t get rid of it. Anyone know what to do? Thanks in advance.

2 Comments
2024/10/31
21:27 UTC

1

How to create and generate structures in the world?

I created a structure and saved it in the structure block, and I would like to know how I can make this structure generate naturally in my world, how to choose the coordinates where it can generate, and its shape variations. Let’s assume it has 4 variations.

0 Comments
2024/10/31
21:23 UTC

1

How to detect if player is flying (Creative Mode)

How can you tell if you are either falling or flying?

2 Comments
2024/10/31
20:17 UTC

1

Are there any wikis with information on what activates "using_item" in 1.20?

This also applies to any other advancement requirement. I see that horn and spy glass activate using_item while fishing rod doesn't, but I can't find any wiki with an actual list for each requirement.

2 Comments
2024/10/31
19:55 UTC

10

Hello, I want to detect when the player is pressing spacebar, but it doesnt work. Im on 1.21.3

5 Comments
2024/10/31
17:54 UTC

18

Cubes and companions cube pt2

1.19

1 Comment
2024/10/31
17:43 UTC

47

Cubes and companions cube pt1

1.19

4 Comments
2024/10/31
17:42 UTC

2

glow entity only 1 player can see that effect

how to make glow entity but 1 player can see, another cant see, i made sth for mage skill

1 Comment
2024/10/31
17:20 UTC

140

Blocks/Ores - A Datapack-Driven homage to Bloxorz

6 Comments
2024/10/31
17:04 UTC

1

j'ai réussi faire un hammer 3x3

/execute at @p [hasitem={item=golden_pickaxe,location=slot.weapon.mainhand.data=0}] run execute positiond ^ ^ ^ if block ^ ^1.5 ^1 air at @p [hasitem={item=golden_pickaxe,location=slot.weapon.mainhand.data=0}] positiond ^ ^ ^ if block ^ ^1.5 ^1 air at run fill ~1 ~ ~-1 ~-1 ~2 ~1 air destroy

7 Comments
2024/10/31
16:54 UTC

1

Increased attack range when riding a horse

Hello, I wanted to make a horse armor enchantment where the rider will get extra attack range when riding said horse. However, I dont know whats the best way to remove the bonus attack range when the player is not riding the horse. Is it by tick function? By advancement? Any help and idea is appreciated!

3 Comments
2024/10/31
16:43 UTC

3

How does the trail particle command work?

I’d assume I need to add some variables inbetween {} or [] right behind the name, but I have zero clue what those would be. I feel like it needs two coordinates since, correct me if I’m wrong, I thought this is the particle the creaking produces between it and the heart when hit, but it also asks for color so I’m unsure.

3 Comments
2024/10/31
16:22 UTC

2

Is it possible to teleport armour stands in bedrock if it is then how do I

I’m trying to make Fnaf in bedrock but I cnat get the armour stands to teleport

2 Comments
2024/10/31
15:47 UTC

Back To Top