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" or "minecraft-bedrock-edition" tag.

429 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
303 views

How do I output a scoreboard value or a selector to chat in Bedrock Edition?

JSON text format in Bedrock Edition is very different from that in Java Edition. The possible elements to go in the {"rawtext":[]} component are: text translate with (args) As you can see ...
5
votes
1answer
531 views

Summoning enderpearls on arrows with custom name shot by a player

I want to shoot an arrow named "GreenArrow" that constantly summons enderpearls named "GreenPearl". Those pearls should execute a command at armorstands within 1 block. That command is /setblock ~ ~-...
5
votes
0answers
315 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]...
4
votes
1answer
128 views

Is there a way to lock head rotation? 1.14.4

I was doing some stuff in my single player world and I wanted my head to always look down, but not making it choppy. You could do execute as @p at @s run tp @s ~ ~ ~ ~ 90 in a repeating command block,...
4
votes
2answers
575 views

Vertically stacked armor stands should have increasing scores, but don't

I'm trying to make a goalpost system for a custom map I'm designing. The idea is that a goalpost--consisting of a tall stack of iron bars--would have variable height, and at each block up and down the ...
4
votes
2answers
191 views

How to make mobs attack each other in Minecraft

Is there a relatively easy way to make mobs attack other mobs, for example zombies attack other zombies? I have tested summonning a snowball as another mob over a zombie, so the zombie thinks it was ...
4
votes
1answer
158 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 ...
3
votes
0answers
42 views

How to protect a player from firework rocket explosion damage?

I try to make a pvp server that players are able to attack each other by using a crossbow loaded with firework rocket.The problem is if the player fires his crossbow too close to themself, they will ...
3
votes
1answer
47 views

How can I increase the knockback of a slime in minecraft?

I'm using command blocks to make a custom slime, I've tried using the command: /summon slime ~ ~ ~ {Size:3b,Attributes:[{Name:"generic.attack_knockback", Base:8.0,}]} but it doesn't work. ...
3
votes
0answers
32 views

Teleport randomly an entity vertically

I want to tp an entity (an armor_stand named "note" exactly) to a random position in axis X and Y, how can I do this ? /spreadplayers only teleport random entities on axis X and Z, but it's not what ...
3
votes
1answer
158 views

How do I use a target selector to output the nearest player's UUID?

I want to be able to use a target selector to select all of a player's tamed wolves. It's easy to do that with this target selector: @e[type=wolf,nbt={"OwnerUUID":"<Player UUID>"}] When I try ...
3
votes
1answer
203 views

Select Players with inventory open using Mincraft Commands

What I'm trying to do: Make sure players always have a particular guidebook/spellbook (a special command-generated one with clickable links and a special tag). If they lose their book, it should ...
3
votes
1answer
2k 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 ...
3
votes
1answer
558 views

Testfor a written book in 1.8 with custom name and writing

So I’m working on a map and need help with the Testfor command. I’ve looked around and tried out several different things and just messed around with the command without help, but I can’t get it to ...
3
votes
2answers
391 views

How can I add one enchant level?

I want to with every command add one enchantment level like this: /replaceitem entity {player} slot.armor.head chainmail_helmet 1 0 {ench:[{id:0,lvl:+1}] Level: +1 Or If I have a helmet with ...
3
votes
3answers
998 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 ...
2
votes
0answers
26 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) /...
2
votes
1answer
62 views

Teleporting player around a corner that face a specific direction

I want to build some kind of non euclidian room in minecraft, where a player should be able to go 2..infinite amount of times around a corner, until he went full cyrcle. But it should only work in one ...
2
votes
0answers
20 views

How can I use [Motion] to make an entity follow a path based on the player?

I get the way the question is formatted, it may sound as if this question has been asked before, and if it has, I'd love to see where I can find it. What I'm struggling with is being able to summon an ...
2
votes
0answers
30 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 ...
2
votes
0answers
38 views

How can I specify only NBT in the /clear command, not an item?

A unique quirk about the /clear command is that it can clear items from the player's cursor, i.e. the one that is picked up and moving from slot to slot. Using this and conditional command blocks, I ...
2
votes
0answers
30 views

How can I join multiple teams with different rules?

I want an Iron Golem, Zombie A, and Zombie B to be on a same team so they wouldn't attack each other but I want Zombie B to have a no collision rule. If I let Zombie B join another team with a ...
2
votes
1answer
38 views

Copy player's armor and offhand items into a chest

I have tried to copy all items from a player's inventory into a chest in 1.16. I have used this command for the hot bar and the 2 first rows in the inventory: /data modify block 227 76 77 Items set ...
2
votes
0answers
46 views

How to detect the item that is being “grabbed” by a player in the GUI?

In the GUIs of chests, furnaces, anvils, etc., or just your own inventory, you click on an item to pick it up, and click again to put it into a slot of your inventory or the container block. What is ...
2
votes
0answers
25 views

How To Automatically make particles when a player Joins Using Commands On Minecraft Bedrock Edition

I am attempting to make a kit PVP on Minecraft and I'm trying to make particles when a player joins the server.
2
votes
1answer
63 views

Maximum 1 entity per block

So when I break an oak_log block I summon an area_effect_cloud with the tag of B.Spawn at the block I jus broke. now I use this command to summon a 3x3x3 area_effect_cloud cube around the [tag=B....
2
votes
1answer
245 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: ...
2
votes
1answer
126 views

How to detect when a player looks at a pig with name “173”

I tried this: /execute if entity @e[type=minecraft:player] facing entity @e[type=minecraft:pig,tag=173] feet run say hello But it didn't work.
2
votes
2answers
305 views

Is there a way to use the glow tag on an item on an Armor Stand without the Armor Stand getting lit

I'm just trying to outline a held item without the invisible Armor Stand getting shown. I don't think there is but it's worth a try asking. Is it possible to only let the item on an Armor Stand glow?
2
votes
0answers
350 views

(Java Minecraft 1.14) How to force entity to make use of Jump Boost in pathfinding?

I am making a 'vampire' mob for a datapack I'm writing. It is a husk where I've set the attributes and everything to make it faster, hit harder, and have more health, and tagged it so I could ...
2
votes
0answers
39 views

Minecraft armor attributed modifier

I have a custom server with attribute modified armor. They only thing I’m concerned about is that the armor modified never seems to get stronger after it adds up to 25. Can someone explain if there is ...
2
votes
1answer
200 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 @...
2
votes
0answers
2k views

What's a good way to make a health bar using the bossbar command (For multiplayer pursposes)

I want to use the bossbar command to create a health bar for the players (each seeing ONLY their own health). So I came to the conclusion that there are two main ways to do so: This is the best but ...
2
votes
1answer
759 views

How to use TrustedUUID?

For a while, I have been experimenting with NBT Data on Minecraft. Recently, I wanted to make a fox that trusts both me and a friend of mine, and I know this is possible, as they have the tag ...
2
votes
0answers
2k views

(Java Minecraft 1.13) What is the max and min elytra glide speed with rockets?

I'm planning on creating an item which when held in the off hand while flying gives the player a constant velocity, like a rocket but passive. To know what I need to multiply the players Motion[], by, ...
2
votes
1answer
259 views

Objective minecraft.custom:minecraft.leave_game not working

I am working on a map, and in this map's function I have a system that gives players who rejoin the map a /title message (rejoining meaning leaving the world then coming back). At first it seemed to ...
2
votes
2answers
520 views

How do you spawn an entity that can be linked to the player that spawned it in Minecraft 1.13?

I'm working on a minigame in 1.13 and am trying to make a command that executes at a players position and spawns an area effect cloud there. I have managed that but I also need that area effect cloud ...
2
votes
2answers
1k views

How do I execute multiple function within another function?

In Minecraft 1.13.2 PC JAVA creative mode Previous title of this question was : What is console command to fly in creative mode? supposing an issue with 'flying'. I want to execute multiple ...
2
votes
1answer
236 views

How to give a player an item if their level is of a certain minimum value, and make sure that they only have one of these items at a time?

I would like to accomplish this using a single command in a command block that is set to repeat, and I'd like to avoid using the scoreboard. I'm looking to check whether or not the player's level is ...
2
votes
1answer
771 views

Making Arrows Fly Faster [1.12]

I'm making a sniper with 1.12 commands. It's working very well (except for the fact that bows don't shoot perfectly) but I have a problem: arrow speed. If you shoot an arrow at minimum speed, you can ...
2
votes
1answer
172 views

ArmorDropChances Data Tag below 0.1?

Im messing around with armor drop chances for a map im creating and I have yet to find out any information on the web explaining this: Does the minecraft binary recognize a value for armordropchances ...
2
votes
0answers
2k views

Minecraft OnGround Tag Help

I'm trying to test for a gold block that is on the ground. I want to use the on ground tag because if I don't, it detects the item immediately after I throw it. The command that I'm using doesn't seem ...
2
votes
1answer
998 views

Player heads linked to player skin id

I know it is possible to give a player head with say ID of whatever skin you want but, I want to make it give the player head with the precise skin at the time the player is killed. I just don't want ...
2
votes
2answers
4k views

How can I summon an object in motion where a player is looking?

I have been trying to figure out throwing knives in Minecraft. Is there an easy way (besides a ton of command blocks) to summon an object where the player is with motion according to where the ...
2
votes
1answer
223 views

How can we change the comparing area of the /testforblocks command?

What I wanted to do was a system that would permit you to save your build in an area, in sort of a nothing is changeable, not even the items in a chest. In fact, how it works is simple: the ...
2
votes
1answer
148 views

How can I keep mobs from being too close together with /spreadplayers and /execute?

I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other ...
2
votes
1answer
37 views

Is there a way to summon a large area of chickens in Minecraft?

Basically is there a way to do this fill 0 4 0 5 4 5 minecraft:chicken but with valid Minecraft syntax? And perhaps if some blocks were occupied by armour stands, prevent the chickens from spawning ...
2
votes
1answer
634 views

How to use item texture variants in Minecraft Java?

I remember, maybe two years ago now, that there was a new feature in Minecraft that allowed you to change the texture of an item in a resource pack depending on a certain NBT tag that was set for the ...
2
votes
1answer
644 views

How to enable spectator mode in a remote “nohup running” server?

We have a mono minecraft server running with the nohup command on Linux, we are using putty to execute commands on the server, but the only way that I could figure out is to kill the Minecraft server ...
2
votes
1answer
1k 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] ...

1
2 3 4 5
9