Questions tagged [minecraft-commands]

Anything related to the usage of commands, command blocks and functions in the Minecraft game series. If you're building a redstone device without commands, use the [minecraft-redstone] tag instead. Always use this tag together with the [minecraft-java-edition], [minecraft-bedrock-edition], or [minecraft-education-edition] tag.

525 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
0 answers
191 views

Is it possible to set tile entity data on an enderman's held block?

Is there a specific command that I can do to summon an enderman holding a command block with a custom command preset? I tried the following command, but the command block doesn't have a command inside:...
user avatar
6 votes
1 answer
2k views

What is the Java Edition method of Bedrock Edition's /ride command?

Story We all know that for the most part, the Bedrock Edition of Minecraft has a very limited command supply, and no NBT access from commands. However, Bedrock Edition has gained a unique trick as of ...
user avatar
6 votes
1 answer
186 views

Is it possible to stop myself from breaking bedrock in creative?

I am trying to plan a farm near bedrock in the overworld. I created a copy of the word location and I would like to plan the farm in creative, then build it in survival with the help of litematica. ...
user avatar
  • 1,929
5 votes
0 answers
300 views

How to change a shulker boxes texture based on its name

So, I have been trying for a bit to find a way to change a brown shulker boxes texture when its name is "Emergency Cookie Rations", sounds silly I know, but every technique I have tried has ...
user avatar
  • 103
5 votes
0 answers
384 views

minecraft command block problem "snowball"

I'm trying to execute this code: execute @a[score_HoldSnowball_min=1] ~ ~ ~ scoreboard players set @e[type=Snowball,rm=3,r=4] Snowball 1 but it doesn't execute the code and instead says: [13:59:43]...
user avatar
  • 95
4 votes
0 answers
158 views

Is there a way to run a command when the player joins the SINGLEPLAYER world?

I'm wondering if there's a way to run a command when someone joins a Single player world, I'm a upcoming map maker and I making my first map, I have lots of experience with Redstone but never got this ...
user avatar
  • 41
4 votes
1 answer
224 views

Hiding team colors in usernames

I'm working on a minigame in Minecraft that is built upon not knowing what role other people are (kind of like a social deduction game). However, since teams are required for the game to function, a ...
user avatar
4 votes
2 answers
959 views

How to make snowballs invisible?

So I'm trying to implement, mostly for entertainment sake, but also for a potential "magic" system later on in the game, a way to make snowballs invisible while in the air. I'm on Minecraft: ...
user avatar
4 votes
1 answer
8k views

Summoning an arrow aimed at a mob

I want to summon an arrow that is fired in the same direction as the player that it is summoned closest to, is this possible with just commands and as minimal command blocks as possible? (not one ...
user avatar
4 votes
1 answer
69 views

Is it possible to trade with villagers using some sort of score? (commands)

I'm trying to make a system that transfers emeralds to a score to not take up inventory space, and that score can be used to trade. Is this possible? And if so, is it possible to display this score in ...
user avatar
4 votes
1 answer
200 views

How do I make this contraption multiplayer?

I made a grappling hook in Minecraft and put it into a structure. However, I want to use it in a multiplayer map where multiple people may be using it at one time. I believe the way it is currently ...
user avatar
4 votes
2 answers
3k views

Change players health based on scoreboard objectives

I have a custom map in which I have a scoreboard objective. Is there any way to change a player's health based on this scoreboard objective? The only thing I could find was putting a button on a ...
user avatar
3 votes
0 answers
47 views

Is it possible to locate the position of a specific block in Minecraft Java

I am building a datapack and I want to replace how diamonds and emeralds function by modifying their generation behavior. But I don't know if this is A : possible and B : worth my time looking in to. ...
user avatar
3 votes
2 answers
158 views

Is there a way to make a dispenser shoot out a fireball with a specific explosion power?

How do I summon a fireball with a specific explosion power in a dispenser? /summon minecraft:fireball ~ ~ ~ {ExplosionPower:200} I know how to summon one with commands, but I don't know how to make ...
user avatar
3 votes
0 answers
50 views

Who is the Command Initiator?

I have been playing Minecraft for years and have an ok understanding of the command system inhabiting it. What troubles me the most recently revolves around the command initiator. As we all know @s ...
user avatar
  • 1,042
3 votes
0 answers
36 views

Best way to dynamically call function

For my project, I have callable objects (arbitrary NBT dict that is theoretically capable of calling an mcfunction) stored on an NBT array (the Stack). At an arbitrary time in execution I want to be ...
user avatar
  • 490
3 votes
1 answer
153 views

Summoning a falling entity on top of an arrow which had just hit the ground

This is just a follow-up question from my previous one, Specific lightning arrow task, after the arrow strikes, and only using a specific bow. So in that one, I asked how would one summon lightning an ...
user avatar
3 votes
0 answers
65 views

Testing the age of a certain item in ticks?

I'm developing a Minecraft server which incorporates realism using a command block network in the center of the map. I'm trying to simulate food spoiling via testing for the age of an item (i.e. if a ...
user avatar
3 votes
0 answers
56 views

How would I test if my custom dimension exists?

I'm making a datapack that relies on a custom dimension. If the dimension hasn't loaded in, it will break things. When you add the datapack to a pre-existing world, then the dimension won't load until ...
user avatar
3 votes
0 answers
135 views

Is there anyway to show a mobs health above their head (1.17, Java) with only command blocks?

I'm making a dungeon style game, and I want the mobs to have their health above their head, and update when they heal or get hurt. Is there anyway to do this with just command blocks/commands. Because ...
user avatar
3 votes
0 answers
53 views

Spawn Mobs With Specific Items Equipped

Hi All, In MCPE 1.16.2, I want to create a way in which when I eat a specific item (call that ‘alpha’), it spawns 4 mobs with a helmet equipped. And also would it be possible to make the mobs work for ...
user avatar
  • 65
3 votes
0 answers
69 views

Test For A Specific Item In Head Slot & Then Activate Something Else

Hi All, I’m trying to create an addon in MCPE 1.16.2 but I’m struggling to do one thing. I want to be able to detect a player with an item on his head and then follow on with another command like ...
user avatar
  • 65
3 votes
0 answers
1k views

Why is Player's generic.movementSpeed Attribute listed on Wiki as lower than ALL Mobs, yet you can clearly outrun all of them?

EDIT: Player's generic.movementSpeed SPRINTING Attribute is listed as 0.15, their WALK speed is listed as even slower (0.1) Original Post: A Player's generic.movementSpeed Attribute is listed as 0.15 ...
user avatar
  • 81
3 votes
1 answer
541 views

How to activate commands around a tagged entity with command blocks?

So I am trying to set the score of a person within two blocks of a tagged armor stand, but the commands I thought would work don't. I have tried execute at @e[tag=GFlag] run scoreboard players add @...
user avatar
3 votes
1 answer
1k views

(Java Minecraft 1.13) How to summon a splash water bottle with no gravity?

Right now, I'm making a "Fire Hose" item which shoots splash water bottles. I've got the velocity and everything working but for some reason it falls much quicker than I expected, and the trajectory ...
user avatar
  • 2,425
3 votes
1 answer
706 views

Creating a minecart spawner that had blocks riding them

I know how in 1.7 you can summon a minecart that has a block "riding" it, as in you can change the block's height above it, what block it is, etc. I also know how to make a minecart spawner. How can ...
user avatar
3 votes
1 answer
283 views

How to make mobs attack other players, but not me?

I am making a minigame where I will have a spider that doesn't attack me, but attacks the other players. I know that I can use teams to turn off friendly fire, but the problem is that everyone is ...
user avatar
  • 77
3 votes
1 answer
434 views

Is there a way to put conditionals in functions?

Is there a way to make something conditional in a function? For example setblock 5 10 5 air tellraw @a {"rawtext":[{"text":"Placed!"}]} # <--- Make this command ...
user avatar
  • 4,973
3 votes
2 answers
1k views

Custom Minecraft 1.8 spawners

I am working on a minecraft 1.8 server and am trying to make a mob spawner that spawns items. This example:How can I make a spawner that summons Items? works on new versions of minecraft but not on 1....
user avatar
  • 41
3 votes
1 answer
540 views

Why does /execute store refuse to update an NBT number when provided with a scoreboard value?

Here are some commands for you to try in MCJE 1.16. Run the following commands in the chat: Set up a scoreboard objective. (or use an existing test objective if you hate piling them up, like me) /...
user avatar
3 votes
1 answer
91 views

How to identify the coordinates of a specific block

I'm creating a wave rush world where every night, enemies spawn from mob spawners and attack you. I found a cave system and placed mob spawners all over it, but now I need help to find all of them ...
user avatar
  • 31
3 votes
1 answer
2k views

Help with command to teleport NPCs

/tp @e[name=Farmer,type=ArmorStand] @e[name=Farmer,type=Villager] Why doesn't it work? I've tried spacing things out, but it just refuses to work! Interestingly, if i just do /tp @e[type=ArmorStand] ...
user avatar
3 votes
3 answers
1k views

Minecraft how to testfor if a mob is looking at the player

Is there a way I can testfor if a mob is looking at the player? I know there is a way to testfor a certain rotation, but is there a way to test if the mob is looking in the general location of the ...
user avatar
  • 596
2 votes
1 answer
32 views

How to check the value of a Tag and execute another command when equal to a desired value?

I'm trying to have a lectern teleport me when I place the correctly named book on its top. So far, I've tried using this command: /execute if data block 50005 10 50009 Book.tag[{title:"Bookname&...
user avatar
  • 21
2 votes
0 answers
101 views

Proper path to modify villager anger?

I would like to make villagers angry on command. I assume I need to use /data modify, but I do not know the proper <targetPath>. I have the following so far: execute as @e[type=villager] run ...
user avatar
  • 805
2 votes
0 answers
97 views

Testing for if an item entity has an ID matching a list of item names

I am making a datapack that uses copper as a fuel, however part of that means that I need to be able to test an item when it is on the ground to see if it is one of the 37 copper items. I have already ...
user avatar
  • 101
2 votes
0 answers
38 views

Using signs to record new joiners to realm

The idea is to automatically place sign with name of a new player to the realm. When a new player joins command blocks give a new player starter kit and add him a tag "Started" to close the ...
user avatar
2 votes
0 answers
58 views

How to detect if a player has touched a block with hand?

I know you can make a scoreboard to detect if a player mined a block, But I don't know how to make something to detect if a player touches a block(not break the block). I'm on java edition 1.18.
user avatar
2 votes
3 answers
227 views

On Minecraft Bedrock Edition, how do I make it so people can't build at spawn?

I know using barrier blocks makes it so people can't break stuff, but how can I make it so players cannot place stuff at spawn?
user avatar
2 votes
0 answers
52 views

Undroppable Quest Items for Minecraft 1.12.2?

I've been creating a modded adventure map over the last three years and have finally decided to deal with an issue that I've been aware of for a long while. I'm trying to make it so certain items are ...
user avatar
2 votes
0 answers
84 views

Check Minecraft Java scoreboard Leaderboards

For various purposes, I need a way to check scoreboard objectives rather than just checking a player's scores. Is there a command I can run that can find the largest score in a scoreboard and who has ...
user avatar
  • 369
2 votes
1 answer
644 views

Did using the /give command to get items with attributes change in 1.17.1?

I've already stumbled upon some similar threads, but none on version 1.17. So my issue is, I want to make custom items (sword, armors…) with custom attributes. I tried copy/pasting some commands, but ...
user avatar
2 votes
0 answers
133 views

Summoning a ring/sphere of arrows around an arrow which had just struck the ground

I've been messing around with bows and arrows and summoning stuff when the arrow hits the ground, like lightning, but I've got an idea I do not really know where to start at. So here's the plan, I ...
user avatar
2 votes
0 answers
33 views

How do I make a "PocketPal" in Minecraft as a pet?

it's StickyChannel92 for another question. How can I make a custom pet in a custom shape that follows me around? I want to be creative with not only with armor stands, but programming them to do ...
user avatar
2 votes
0 answers
84 views

Prevent people from using levers

I'm making a battlefield and want to include an area for "admins" and the like to enter and leave a certain area without others being able to do the same thing. I don't want to use commands ...
user avatar
2 votes
0 answers
43 views

How to make a scoreboard of how far someone has walked? (Minecraft Bedrock Edition)

I'm trying to make a leveling up system for an add-on I'm making for Bedrock Edition and I need to make a scoreboard of how much someone has walked/ran, I can't figure out a way to do this.
user avatar
  • 41
2 votes
0 answers
327 views

How to make colorful "flash" particles in minecraft

When i use the command /particle minecraft:flash ~ ~ ~ 0 0 0 0 3, it creates a white explosion, but firework explosions give the colorful version of the same particle. How do i colour it? Is it some ...
user avatar
  • 157
2 votes
0 answers
35 views

How can I make a command block say a formatted player's inventory?

I'm trying to make a command block say a player's inventory items. I tried /say data get entity @p Inventory But it didn't work. Also, is there a way I can format the output so it will be like: [64] ...
user avatar
  • 21
2 votes
0 answers
34 views

Make Minecraft commands take priority over plugin commands

I'm running EssentialsX on my Minecraft server and I don't like the EssentialsX versions of the Minecraft commands they add. To allow me to use the Minecraft ones like I would traditionally, I ...
user avatar
  • 21
2 votes
0 answers
87 views

How to teleport every player to a different location?

I’m working on a Minecraft map. My plan is to teleport everybody (at the "event") to a different location. So the problem is that I cannot do: /minecraft:tp @a[team=event] ~ ~ ~ because it ...
user avatar

1
2 3 4 5
11