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.

423 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
486 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
279 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]...
5
votes
3answers
1k views

How to detect for player with custom head

I'm working on an adventure map with quests etc, and need to testfor a player with a certain item in their inventory. The item in question is a custom head with a few attributes–here's the /give ...
4
votes
2answers
538 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
1answer
66 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
1answer
150 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
2answers
40 views

How do I combine text inputs in JSON?

I want to combine some text and then a score from a scoreboard but I cannot get this to work. This is what I have currently: /tellraw @a {"text":"test","score":{"name":"player","objective":"...
3
votes
3answers
166 views

Is there a way to spawn mobs with unique names?

I'm an avid Command Block user for Minecraft: Bedrock Edition and I'm currently diving into a system for a Boss Spawner for what's essentially an RPG-style dungeon with a Boss Spawner and boss at the ...
3
votes
0answers
94 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
701 views

How to teleport seamlessly?

So I'm trying to make one of those "infinite hallways" things, and when I teleport the player there is a short frame of something every time. I am teleporting relative the player shouldn't be able to ...
3
votes
1answer
1k views

Having problems with the 'distance=' command in Minecraft 1.13.2

I'm having some problems, a problem that seems simple, but seems to keep eluding me. The command I'm using as a test is this: /gamemode adventure @a[gamemode=creative,distance=..2] Above that, I ...
3
votes
1answer
400 views

How would one go about placing a block and having command blocks place blocks relative to the initial block placed?

I figured it has something to do with using the /scoreboard command to create a scoreboard like this /scoreboard objectives add example minecraft.used:minecraft.id "example name" but from there I ...
3
votes
2answers
323 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
1answer
531 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
3answers
939 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
22 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
47 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
119 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: Bedrock ...
2
votes
1answer
83 views

Explosive Lightning?

I want it so that when lightning strikes the ground, it explodes the ground, how can I do this with just command blocks without using behavior packs or mods? Even if the command is long, I would ...
2
votes
1answer
78 views

How to get a block with NBT on xbox?

I have tried to use pick block on xbox but it will not get the data saved for what I pick even with other buttons.
2
votes
1answer
434 views

How to GET minecraft world spawn with commands?

I would like something opposite to /setworldspawn, a command that would return me current world spawn location. I tried getting SpawnX, SpawnY and SpawnZ nbt data from a non-existing player, but it ...
2
votes
1answer
117 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
192 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
268 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
38 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
1k 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 ...
2
votes
1answer
133 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
1answer
106 views

How can you give yourself a block if you break that block using commands?

I'm trying to figure out how to get blocks by breaking them using commands. Say I'm breaking a diamond ore block and tile drops are turned off so other players can't steal your blocks. Is there a ...
2
votes
0answers
1k 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
590 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
1k 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
216 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
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
197 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
674 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
134 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
2answers
124 views

How do I compare a message in chat to another pre-made message?

You might be a bit concerned about this question, well, I'll explain it! I want a command block to be searching for anyone saying .clearchat and if it comes out true it will clear chat. Is it really ...
2
votes
1answer
413 views

Minecraft execute command gives error message “Could not execute ”detect“ as Creeel”

I am trying to make a puzzle map and I want a redstone block to be placed when a certain block is broken. I am putting this command into a Repeating, Always Active command block: execute @p ~ ~ ~ ...
2
votes
1answer
465 views

Minecraft spawneggs CanPlaceOn

I am trying to give myself a wolf spawn egg named Bradley (or a different name) that can be placed on grass. I have tried: /give @p minecraft:spawn_egg 1 0 {Entitytag:{id:"Wolf",CustomName:"Bradley"...
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
899 views

detecting item with custom name and amount

So I'm wanting to detect a certain amount of a named entity, I have the majority of the command, but I cant figure out how to add the amount. Here's my current command. /testfor @a {Inventory:[{id:"...
2
votes
1answer
897 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
3k 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
9k views

Having problems trying to add multiple objectives to sidebar using command blocks in minecraft

I have had the objective KillCount on the sidebar for some time now, but I recently discovered the possibility of several objectives. Therefore I have been trying to add the deathCount, killCount and ...
2
votes
1answer
202 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
145 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
419 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
619 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] ...
2
votes
1answer
120 views

How to change entitydatas for this project?

I'm making an underwater city. When I will be finished I would like to have citizens and guards in it. Is there a way I can either make an entire new entity or just edit a Villager's skin and get rid ...

1
2 3 4 5
9