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.

Filter by
Sorted by
Tagged with
5
votes
3answers
19k views

My name includes space - How do I enter my username when typing command?

My username in Minecraft is sun solar arrow. This name includes spaces. Situation - When I want to get OP privilege, a user who has OP privilege will enter: /op sun solar arrow But my username ...
0
votes
2answers
35 views

How do I use /testfor to help for a Capture The Flag game?

In Minecraft, I am making a capture the flag game. However, I am having trouble making commands so that there must be 4 players in order to start; once there are 4 players, the players will push a ...
10
votes
4answers
11k views

Is there a way to set an “Adventure Mode Boundary” in Minecraft?

Is there a way to set an "Adventure Mode Boundary" in Minecraft? I am trying to create this village where players can spawn in, and then set out to explore the world and build and do normal minecraft ...
3
votes
1answer
25 views

How can I make only certain blocks of the same type breakable?

I am creating an adventure map, and am experimenting with using the NBT tags CanDestroy and CanPlaceOn to control which blocks a player can place/break. I have already made a pickaxe that can mine ...
2
votes
0answers
21 views

How to teleport Minecart with chests above a players head?

I've been having trouble making menu GUIs in 1.16. My best idea so far was to create a command making it so when ever there is a nether star in my inventory it teleports a minecart with a chest in it ...
3
votes
1answer
29 views

Is there a way to put spaces in a scoreboard player name?

This was a bit hard to give a name to (since it's just really hard to explain, if there is a better title for this question, then go ahead and change it via an edit). Note that this is only focusing ...
0
votes
2answers
342 views

The paragraph symbol to change text color in Minecraft won't appear

So I've recently been working on a world and using the command blocks to add special effects and such, and I've had no issues with anything. Then I log off to eat dinner last night and then log back ...
1
vote
1answer
22 views

How can I set a player's scoreboard score to a player's coordinates [1.15.2]

I am creating a map in Minecraft Java Edition 1.15.2. I would like to be able to get the X coordinate of a player and store it in a scoreboard value. How can I do this?
0
votes
1answer
74 views

How can I allow players to view inside of a chest without being able to take out items? [closed]

I am working on a trading system between two players with command blocks, and I want to use a chest as an intermediary. I want players to be able to see the contents of the chest, and hover over items ...
0
votes
1answer
17 views

Is there any way to change a non-player entity's data in Minecraft 1.7.10?

I need this rather old version for an experiment which likely doesn't work in newer versions. Unfortunately, the /entitydata command was added in 1.8 (and the /data being even newer. Is there any way ...
-2
votes
2answers
66 views

How do I get back to the overworld?

I accidentally used /spawnpoint in the end in Creative Mode. Now, I keep respawning in the end, and my end portal won’t send me back to the overworld. What can I do to get back?
1
vote
1answer
27 views

How do I get the Kill command on a command block to work?

I know this question has been asked a lot, but none of the answers fixed my problem. I am using education edition, by the way, so maybe that is why. Anyway, I plug in the /kill @p command to my ...
0
votes
0answers
27 views

How to target the player who kills another player with a custom snowball?

I made a custom snowball that can give instant damage effect when it is thrown near a player which makes it appears to be like the snowball actually deals damage to player. I want to add up the score ...
2
votes
1answer
212 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 ...
13
votes
4answers
23k views

How do you add NBT tags to commands in Minecraft Pocket/Bedrock Edition?

How do you add NBT tags to commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s potion 1 0 {Potion:"...
0
votes
1answer
23 views

How can you detect when a player is looking at an entity in Minecraft Bedrock?

I'm trying to detect when a player is looking at another player to re-create Dream's 'Speedrunner v Assassin' video with GeorgeNotFound, in which if George looks at Dream, Dream becomes frozen. I ...
-3
votes
1answer
1k views

How to Detect Blocks That is Not Air [closed]

I am trying to make a command line that armor stands is moving and if armorstand is touching a block they say block! and the real question is how can I detect a block that is not air ?
3
votes
1answer
3k views

How to use ^^^ coordinate systems for motion nbt

Since we can use ^ ^ ^ for relative coordinates with 1.13 like /execute as Asaf31214 run summon lightning_bolt ^ ^ ^10 (Summons a lightning at 10 blocks from me to the direction I look. By the way, ...
0
votes
2answers
29 views

Is there a way to find the NBT of a player head?

Let's say I have the head of a player by the name of "Player" (creative, I know). If you have the physical head in your inventory/stored somewhere/in your possession, and that head has the ...
4
votes
1answer
35 views

Display or say the current daytime ticks

I'm experimenting with some redstone and need to get a running display of what the current daytime ticks are. I'm working in a single player creative world. I can get this manually by running "/time ...
0
votes
1answer
33 views

How to tell if a certain item is in a player inventory [duplicate]

I am trying to create a challenge world where a certain item (e.g. netherite sword) must be collected. How can I check automatically if a player has it (using commands), and then congratulate the ...
5
votes
1answer
93 views
+50

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 ...
1
vote
2answers
51 views

How can I make players spawn with a sword after dying?

I am making a bedwars map in Minecraft. In real bedwars, when a player dies, they keep only their sword. How can I make it so that players spawn with a wooden sword?
4
votes
1answer
54 views

How can I use /setblock in 1.12 to make a blue banner?

I would like to be able to use /setblock to make a blue banner in Minecraft 1.12. So far I have the following command in progress: /setblock ~ ~ ~ minecraft:standing_banner 4 But I've tried adding 4, ...
0
votes
0answers
17 views

How do I continue a data pack function even when a command fails?

I am very new to data packs, and while messing around with /execute I ran into a problem. As of 1.16.1 there is no "else" subcommand for the /execute command, meaning I have to do something ...
1
vote
2answers
37 views

How do I invert the /testfor command's result? (1.12 and below)

/testfor, /testforblock, and /testforblocks are all part of the same group of commands and are similar in what they do after their test. They are only useful when their output is measured using ...
0
votes
0answers
25 views

How do I /kill a specific item on the ground with CustomModelData?

I m trying to make it so that some specific items would be undroppable. Im trying to do this by killing the "undroppable" items when on the ground. I know that /kill @e[type=item] would kill ...
2
votes
1answer
28 views

Why does my /tellraw throw an “Unterminated string” error?

My server is version 1.16.1 and I'm trying to run the command: /tellraw @a ["",{"text":"Co-op >","color":"aqua"},{"text":" [PIG"...
1
vote
1answer
28 views

Can you make a repeating command in minecraft with /data command, that only affects any entity once?

I am trying to make a command block command for server I am playing at, that would make any creeper near it not explode. As they still somehow spawn where they shouldnt and keep blowing up behind ...
4
votes
0answers
43 views

Ender Dragons spawned with commands center their behavior at (0,0). Can this be changed?

I'm trying to create a 1.16.1 adventure map which includes an Ender Dragon boss fight. I've figured out how to summon a dragon in the Overworld that isn't passive, but the problem is that the dragon's ...
1
vote
1answer
30 views

How can I target the same player that was previously targeted randomly?

I am making a Minecraft commands map and need to give a random player two effects and one item. I understand that each effect/item needs to be given in a separate command. The problem is, @r targets a ...
-1
votes
1answer
33 views

minecraft player detection between 2 points [closed]

So I am working on a minigame server and i need to test for ALOT of areas in the world and when players fall into them. I'm trying to use the relitave x~ y~ z~ for this but in this command: execute if ...
1
vote
3answers
903 views

Cave sounds on Bedrock Edition

I can't seem to get the /playsound command to play ANY cave sounds nor underwater sounds. I can't find the right syntax for Bedrock, only Java. Does anybody know a command that works for cave sounds ...
1
vote
0answers
19 views

How do I make fire form if a specific splash potions lands?

Title says it; I need a splash potion that works like a molotov, I need this to be in vanilla and any help is appreciated!
0
votes
1answer
47 views

Is there a way to detect a player with relative coordinates to the command block?

Using the command: execute if entity @p[x=21 ,y=56 ,z=-132 ,distance=..4.5] works but won't work if I use relative coordinates. e.g. command:execute if entity @p[x=~ ,y=~ ,z=~ ,distance=..4.5] I need ...
0
votes
1answer
37 views

Select teams using /tellraw command?

I would like to know if it possible to use teams with the tellraw command. I know that you can use it to select players (e.g. /tellraw @a {"text":"","color":"blue","extra":[{"selector":"@p"},{"text":"...
1
vote
0answers
22 views

What is causing some custom sounds to not follow the player?

I'm working on an adventure map in Java Minecraft that requires sounds to be played to the player. These sounds should follow the player around such that the origin of the sound is the player ...
-1
votes
0answers
10 views

Can i use items as bullets in crackshot plugin?

I searched out the crackshot plugin configurations and everything and there is an item id option to add as an subtype to the bullet but it doesn´t seem to work, the bullets are snowballs but i wanted ...
2
votes
1answer
105 views

Is there a way to reward Items based off scoreboard points?

I am making a server based on PVP and I have set up a scoreboard that displays a players kills. I was wondering if, say for example, a player reached 50 kills could I give them a reward? (e.g diamond ...
1
vote
0answers
29 views

How do you convert a custom-item /give command into a villager trade? (in general) [duplicate]

I know this is similar to many other questions out there, but I just wanted to ask not only how to convert a custom-made item into a villager trade, but also if there is a general way to convert said ...
1
vote
1answer
36 views

How can I run a command if one or more conditions in /execute are satisfied?

In Minecraft 1.16.1, I’m trying to make a system thats detects when one of several fake players doesnt have a specific score. Here is my first attempt: execute unless score sticks_have page-2 matches ...
2
votes
1answer
538 views

How can I find a command block on a realm?

I was playing on a realm and someone hooked up a redstone clock to a command block that clears command blocks from your inventory, and I was not amused. I can't find it! D: I want to delete the ...
-4
votes
1answer
38 views

Command Block Works then Stops Working [closed]

I play Minecraft Java Version 15.1.1 on a good-specs PC. I've been trying to figure out how to use command blocks but I don't know what keeps going wrong. I'm putting the Command Block well and good ...
2
votes
0answers
13 views

What order are target selector results returned in if the sort parameter is set to “arbitrary”?

Target selectors are used to select certain entities. They accept different arguments to choose which entity to select. Usually, this returns a list of found entities. Using the limit=n parameter ...
1
vote
1answer
38 views

How can I number players returned by a target selector?

I would like to test for players in a certain area and number them. A target selector always returns a list of selected entities in the order of the sort parameter. For example, the following target ...
0
votes
1answer
35 views

How do I use command blocks to check the scoreboard for one player remaining?

Im trying to make a world where survivors have to live for 5 minutes, or the "Hunter" has to kill all the survivors within 5 minutes. Im using an xp timer for the clock, so all im stumped on ...
1
vote
1answer
246 views

Help using /fill command with NBT tags on spawners in 1.14

I'm working on a mob grinder, and have some spawners I need to place. However, I'd like the player diatance tag to be 1000, instead of the usual 16. I know it should look something like this: /fill ...
-2
votes
0answers
31 views
-1
votes
1answer
36 views

Can't get item with lore or custom name

I am trying to give myself an item with a custom name as well as some lore. I tried /give <my username> tripwire_hook{display:{Name:"{\"text\":\"Dungeon Key\",\"...
-3
votes
2answers
4k views

How do I name a item without italics and make it unbreakable?

So I have a minecraft server and I want to make a pickaxe that is named without italics and is unbreakable. This is the command I tried: Give [playername] WOOD_PICKAXE {Unbreakable:1,Display:{LocName:...

1
2 3 4 5
74