Questions tagged [minecraft-commands]

Anything related to the usage of commands or command blocks in the game Minecraft. If you're building a redstone device without commands, use the minecraft-redstone tag instead.

Filter by
Sorted by
Tagged with
6
votes
2answers
9k 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:"...
19
votes
2answers
3k views

How can I fix “unbalanced brackets” in my data tag?

Often, when making a command block contraption, you need to set an entity's data tag. These tags can sometimes be very long, with many layers of nested curly and square brackets. For example, this is ...
6
votes
1answer
250 views

Why am I getting an 'unexpected token' error with this command?

I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is: /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","...
14
votes
8answers
24k views

How do I select all but two types of entities in Minecraft with the type selector?

I've asked this question towards a developer for Minecraft and I thought I'd ask here too since they might not see the question. How do I select all but two types of entities in Minecraft? For ...
4
votes
3answers
67k views

How to test for an hold item name in Minecraft?

I'm trying to make a command block that spawns an item in front of you if you are holding an item with a specific name. I've got these two working scripts; /testfor @p[r=10] {Inventory:[{tag:{display:...
9
votes
4answers
7k 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 ...
15
votes
3answers
63k views

How can I make a block only be placed on certain other blocks

I want people to only be able to place TNT on only Quartz Blocks and I've see this done before where you can only place blocks on certain other blocks but I'm not sure of the command used to do that. ...
8
votes
6answers
28k views

How can I make a random number generator with command blocks in Minecraft?

I want to make a mini game in Minecraft were I need a random command generator for 9 commands. I need a random command to give the player a random item. I can't do the command block in the dispenser ...
5
votes
5answers
3k views

Is it possible to mark or modify a player with a specific item in their inventory

I'm building a CTF map of sorts, using command blocks in vanilla 1.8. I've discovered two commands for detecting if an item is in a players inventory: /clear @a[team=Red] banner 4 0 /testfor @a[team=...
24
votes
3answers
5k views

How do I fix 'Invalid JSON' errors?

I've been at this for almost two hours and no one seems to have the same problem as I and I doubt this will be solved but I'll try anyway. this is the code /tellraw @p ["Would you like to teleport?",...
11
votes
7answers
12k views

I've lost a command block, how can I find it?

I've placed a command block making it day all the time. I want to turn it off, but I've lost it. What's the quickest way to find it?
4
votes
3answers
3k views

How can I apply an effect when a player left-clicks/right-clicks with an item in hand?

Is there a way so that I make make it when I left click/right click with a certain item it applies an effect? I know that you can apply attributes to wearing armor and things but I want it so when you ...
16
votes
1answer
10k views

How do I make a setblock or a fill clock?

Often, when asking about command block contraptions, people suggest using a "setblock" or "fill" clock? What are those and how do I make them?
7
votes
1answer
84k views

How do I give players already enchanted Tools/Armour/Weapons

I'm making a map where I want players to be able to choose there kits/classes. The problem I'm having with it though is giving players already enchanted Tools/Armour/Weapons. I'm not sure if you can ...
4
votes
4answers
92k views

How do I test for a player at specific coordinates?

If I do: /testfor @p[x=,y=,z=,r=] It says: The entity UUID is in an invalid format.
24
votes
5answers
230k views

Is it possible in Minecraft to switch over from survival to creative in single player?

This question is regarding the minecraft Beta 1.8 prerelease -- I have a beautiful house in single player survival which I'd like to record while flying. I want to be able to change the game mode of ...
8
votes
4answers
12k views

How can I detect if a player has a specific item with a specific datavalue in their inventory?

Let's say I want to track a group of players to see which one of them (if any) have a specific block type in their inventory that's of a specific datavalue; for instance Red Wool (minecraft:wool with ...
4
votes
1answer
280 views

Command for spawning chest with a CanPlaceOn tag

I am making a Minecraft Mini Game adventure map, and one of the levels has a /setblock command, I am using the command in a way to spawn an item in a chest (Wooden Button) I need the wooden button to ...
4
votes
1answer
1k views

How do I give myself an item that can only be placed on a block with a certain damage value?

I'm currently in the process of making a custom map and I want to add blocks that can only be placed on a certain colour clay. This is the command I tried using. /give @p cobblestone 1 0 {CanPlaceOn:...
11
votes
3answers
101k views

Syntax to add multiple commands to a single command block

I am looking to try and set multiple commands in a single command block, but so far everything I have tried just returns "Unknown Command". What is the format for writing multiple commands in a ...
3
votes
1answer
1k 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, ...
11
votes
1answer
57k views

How to set a command block with a command inside using the setblock command

Does someone know how to set a command block with a command inside using the setblock command? I have created this code /setblock <x> <y> <z> command_block {TileEntityData:{Command:"...
2
votes
1answer
265 views

Why is my command throwing a 'data tag parsing failed' error?

I am trying to lock some boxes in a map of mine, and I used this command: /blockdata 10 4 9 {Lock:Elyiana's Mage Key} At first it worked, but then when I logged back on the next day it gave me this ...
2
votes
3answers
5k views

How to set Command Block(s) to test for a particular time and output a message?

I simply want one command block to test for the time of day or night (e.g. time = 18000) and output a message in the chat to everyone if that time returns true. I was trying a simple set-up with two ...
3
votes
3answers
2k views

'Unbalanced Curly Brackets' Error with this command block code, what am I doing wrong? [duplicate]

I am trying to make a chest that is called 'I' that has another chest inside called 'II' that has another chest inside called 'III' that has another chest inside called 'IV' that has another chest ...
2
votes
2answers
4k views

Can't Use /Summon Command

Recently I've been messing around with making a few minigames, and have used a few plugins to help make it easier to create and run them. However, a newer one I'm making requires me to use the /summon ...
36
votes
1answer
4k views

What are the basics of commands in Minecraft Java Edition?

What are the basics of Minecraft commands? If I were to start from scratch, with no knowledge on the topic, what are some things that I need to know?
5
votes
1answer
918 views

Use /testfor to make a custom command

Basically, I'm trying to recreate the Faction plugins /f map in my single-player without mods as my PC doesn't run them very well. (I know it sounds strange.) I am trying to use the /testfor to test ...
4
votes
3answers
20k views

Can you use /testfor to detect the death of a player?

Can you use the /testfor command in minecraft 1.8 to find out if a player has died ? I need it for my map, where 2 players (Only) are pitted against eachother. I want it so that when one of them dies,...
4
votes
3answers
11k views

Run command whenever someone joins a Minecraft server

Is there any way to run a command automatically when a player joins the server? I need to do this without the use of a Bukkit plugin. I think it's possible with MCP but I want to know how!
10
votes
1answer
824 views

Why remove redstone dust from my command block contraptions?

Whenever I show my command block contraptions to my friends, they always comment that I should remove the redstone dust from them. They say it causes lag and that redstone can be unpredictable, but I'...
4
votes
2answers
1k views

How to use exclamation marks in Minecraft commands?

I know that you can use exclamation marks in Minecraft commands to check for an entity that does not have a specific tag. For example, you can use /kill @e[type=!Player] to kill all entities except ...
0
votes
1answer
516 views

No chatoutput in tellraw onClick Event [duplicate]

I'm using a /tellraw command to display some kind of menu to the player. How can I react to the clickEvent without posting something in the chat? When I try using the scoreboard, I get an output in my ...
-3
votes
1answer
114 views

How to combine NBT tags in two different commands?

Can you help me to add one command to other one? I can do them separated but I can't put them together. Below are the commands /give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"]} /give @p ...
8
votes
2answers
5k views

Selecting previous target in a second command block

I'm trying to make a system that prevents players from using certain items. In one command block, I have the following command clear @a diamond_sword executing constantly through a clock. Off the ...
1
vote
4answers
28k views

How to Teleport Players When They Enter a Certain Area/Coordinates

I am trying to teleport a player to certain coordinates once they enter an area. The idea is that they walk into a really small building, but once they turn a corner, they get teleported into a ...
6
votes
3answers
33k views

Minecraft 1.13 display:{Name:“”} NBT tag

This is my first question and forgive me if I am doing anything wrong. I am in 1.13 Pre-Release 7 trying to make a one command creation and I need an item with a specific name. The command I use is /...
5
votes
1answer
153 views

Why does testfor sometimes output an error?

Because there are so many questions asking about this, but not closed as duplicates, I decided to make a uniting question here: There are two three four basic situations here: Why does the /testfor ...
5
votes
4answers
58k views

How do I craft command blocks?

I went to my friends house, and he was playing Minecraft on the PC. He showed me a command block, but when I went home and opened Minecraft pocket edition, I went to the crafting table but I could not ...
2
votes
3answers
10k views

Possibility to spawn mobs in random places

I was wondering if it is possible for you to make a command block spawn hostile mobs in random places in a specified area? I need the mobs spawned on different Y coordinates too because you need to ...
2
votes
1answer
9k views

Summon item not working

I'm making an adventure map, and at some points I need there to be items on the ground. But when I use the /summon command, it always ends up as a stone block. Here's what I've used: /summon Item ~ ...
7
votes
6answers
48k views

How do I remove a summoned Ender Dragon with no AI?

So I used the command /summon EnderDragon ~ ~ ~ {NoAI:1} so that I would have an Ender Dragon that would just sit there. I then wanted to get rid of it, but doing /killall EnderDragon didn't work, ...
5
votes
1answer
3k views

How to make your player invincible / undetectable by zombies?

Ok, I want my character to either be ignored by zombies or unable to die (invincible). I've tried: Adding a health scoreboard but this is uneditable A repeating command block that gives the player ...
4
votes
4answers
7k views

How to use testfor with a mob with a two-word name?

How can I test for mob who has a name with two words? For example villager named Grumpy Bill. For example I want to kill this villager. This command /kill @e[name=Bill] would work just fine but ...
3
votes
1answer
3k views

Mob Arena - Mob vs. Mob

I want to make an arena where mobs will fight each other and a player can bet on one side or the other. For example: There are 2 skeletons in dyed armor; red and blue. Each color representing a team. ...
1
vote
1answer
116 views

Player variable in signs

I'm trying to make a minigame where you have different kits. You step on a pressure plate and get all your armor and effects added. That's all working fine. I'm trying to make it so it places a sign ...
1
vote
1answer
484 views

How can I filter items with a certain enchantement?

I am trying to build a custom Adventure Island. At this moment I am trying to limit the allowed items on this island. I'm trying to do this by filtering on a certain enchantment which is not item-...
-4
votes
5answers
25k views

How To Get Command Blocks Talking in Chat

I need a way for a command block to say things in chat when it is powered, or more preferably whenever someone spawns into the world.
5
votes
4answers
668 views

Minecraft Inventory Saving

I am making an RPG map, and was wondering how to "save" the game. If you die, you would revert back to a save that happens automatically or manually, and I was wondering how to have it so that you ...
1
vote
2answers
717 views

How can I let player click text to use a command?

I want players to be able to click text to run an OP command even if that player is not an OP. For example something like: Console: Do you want to enable Fly? [If you do, Please click here] *Player1 ...