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
3
votes
4answers
7k views

How can I create a copy of an entity using command blocks?

More specifically, say there's a pile of items on the ground, for instance after someone dies, and I want to create an exact copy of each of those items (NBT tags and all), but in a different (...
1
vote
3answers
3k views

How do you summon mobs to dropped items?

How can I summon a mob at the same place as a dropped item? I tried /summon Zombie @e[type=Ingot.iron] but I couldn't get it to work. Also, is it possible to summon mobs to a named item, e.g. an ...
12
votes
2answers
25k views

What commands are counted as 'cheats'?

When making a new world, on the screen where you can turn on the Bonus Chest, Structures etc. you have a button for turning on Cheats. Now I know the command /gamemode <mode> [player] can not ...
2
votes
2answers
349 views

Sonic the hedgehog style boost pads in Minecraft?

Is there a way using command blocks or plugins to alter a player's momentum (xyz) when they step on a pressure plate? /entitydata works for mobs, but unfortunately it does not affect players.
3
votes
2answers
3k views

How do I target only players who are at a certain height?

I own a server, and have built a large indoor structure at spawn. I would like new players to spawn inside this structure. Upon research, Minecraft automatically spawns all players at the highest ...
6
votes
4answers
2k 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 ...
17
votes
5answers
636k views

How do I use the /kill command to ONLY kill mobs?

I have a Redstone Power loop that connects to a Command Block that is set to kill all entities except for myself (/kill @e[type=!Player]), because I'm building a creative map, but don't want slimes ...
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
0answers
803 views

How Do You Enchant, Name, and Give an Item Lore in Minecraft Using a Single Command? [duplicate]

I know how to do the commands already, but I can't seem to be able to get to do it all in one command, because I can't target an already made item so I can enchant, but not name/ give it lore.
2
votes
1answer
2k views

How can I replace the snowball particles with a creeper that has a fuse of 0?

I want to make some exploding snowballs but I'm failing to figure out a working command. The snowballs must explode when it hits something, but must not damage any blocks. I figure summoning a creeper ...
0
votes
2answers
3k views

How do you make 2 command blocks go off at once?

So I'm making a small adventure horror map, and there's suppose to be a death scene where the player steps on a pressure plate and a vine comes and kills them, but I want the command block to not only ...
1
vote
2answers
919 views

How can I detect a player's score against other players?

I'm creating a PvP map in Minecraft and I'd like to track how many times a player has hit other players on a scoreboard. I'm not tracking kills; I'm tracking hits. How can I do this? I'm not tracking ...
-5
votes
2answers
11k views

is there a command that kills all horses and nothing else? [duplicate]

is there a command that kills all horses and nothing else
2
votes
4answers
48k views

How to put a copied command in a command block?

If you have copied a zombie herobrine command what do you press on your computer to put the command in the command block?
0
votes
3answers
5k views

Teleport entities relatively to the center of a block

I just wanted to teleport an entity relatively, but the entity is not exactly in the middle of a block. For example the coordinates are 0.3, 63.0, 0.76 and I teleport the entity relatively using ~1 ~...
-2
votes
1answer
15k views

How can I kill all other entities except for tamed wolves and players? [duplicate]

I use this command kill @e[type=!Player] to kill everything except for players, but does anyone know how to make it not kill tamed wolves/dogs as well as players?
2
votes
2answers
1k views

Is there any way to make horses unable to jump?

I made a horse track in Minecraft, but I don't want people to be able to jump over the starting gate at the beginning. I tried using /effect @e 8 1000000 150, which made me unable to jump but made the ...
1
vote
3answers
34k views

Remove potion effects using command blocks

I made a horse race track and at the start everyone gets slowness. At the end when they cross the finish line I want them to lose this effect. How can I achieve this?
2
votes
1answer
874 views

How can I just clear an item with a name, not all items of the same type?

To start off, I just want to say this is probably easy but I am tired and just getting the hang of this. But anyway, I am trying to make a command block that when activated will clear your inventory ...
1
vote
2answers
1k views

How can I kill all entities of a specific type, EXCEPT the youngest one?

I want to create armor stands whenever I stand on a certain block, but when I stand on it, it summons a lot of armor stands. I tried /kill @e[type=ArmorStand,c=!1] to kill all except the newest one ...
2
votes
2answers
2k views

How to make command block stop outputting signal? [duplicate]

I want to create a command block with the command /clear @a[r=5,m=0] 570 (Yes, it is an ID from a mod, but it does not matter anything). I want to detect when this command has succeeded using ...
2
votes
2answers
9k views

How can I /fill water?

I have a huge amount of area that i need to fill relative to the player's place. I tried typing /fill ~-80 69 ~-80 ~80 69 ~80 water which basically fills a 160x160 hole 1 block deep relative to the ...
8
votes
6answers
2k views

How do you teleport a player to a moving objective?

I created a big adventure map and I was able to do lots of amazing things I never thought possible with redstone, but I came across a problem I was baffled by. I have a house in minecraft that is ...
2
votes
3answers
664 views

How can I make a tool drop blocks with CanPlaceOn tag

In Adventure mode, I'm trying to let a player get blocks that he can place later, is there a way to do it directly or do I have to change them in his inventory? Situation: The player gets a tool that ...
4
votes
4answers
9k 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
2answers
3k views

Is it possible to disable the 'Block Placed' message when using tellraw /setblock?

I want to make a /tellraw shop but to activate command blocks I want to use /setblock command when clicked on a text. Is it possible to disable "Block placed" text showing up?
9
votes
4answers
61k views

How can I spawn items into a chest, using Command Blocks?

Like the title states, I want to be able to spawn items using a command block, and have them placed into a chest. And I don't want to replace the chest, I want it to just add my block into the chest....
1
vote
1answer
465 views

Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate]

I am playing around with command blocks, and I just wanted to know if you could have multiple commands in one command block. If you can, is it possible to have one of the commands active when the ...
1
vote
3answers
9k views

I can't seem to copy and paste commands into my command block

Whenever I try to copy and paste a long command into a command block, it seems to work, but then when I click "done," and then go back into the command block, the command is erased. I don't know what ...
2
votes
1answer
320 views

Can I add a height measurement in a command block?

I just need to know if it is possible to add a height measurement in on the command block in Minecraft light you can do radius. Would it maybe be something like h=<Hight>
1
vote
1answer
2k views

I'm getting "Unable to locate name/value separator for string" when setting up a command block to give a magic stick?

I'm trying to set up a command block that is used to spawn in a "magic wand" with knockback & fire aspect. I've got the spawning of the "wand" itself down, and I can do that no problem. However, ...
0
votes
1answer
841 views

How to use command blocks to make a private faction

So basically I want to use a command block to tp anybody but me out of my faction upon entering. What my command block says. /testfor [r=5,Name=Gamersfunhouse]* *I also have this for every other ...
0
votes
1answer
1k views

Spawn a villager with a certain effect

After seeing this post about making zombies run in a particular direction/fashion, someone suggested spawning in a Villager to run from the Zombies. This made me think, can you summon an entity with ...
5
votes
1answer
39k views

Killing all entities except players and armor stands [duplicate]

Is there a way to kill every entity except players and armor stands? I've tried with /kill @e[type=!Player,!ArmorStand] and /kill @e[type=!Player;!ArmorStand] But it doesn't work. How can I do ...
2
votes
1answer
1k views

How can I check if an entire team has died?

I'm making a Minecraft minigame map using commandblocks (no code or mods). One of the game end conditions is that a team is eliminated. How to I reliably check that a team has no members left alive ...
-1
votes
1answer
876 views

Is there a way to detect the number of players on a server? [closed]

In Pizzaspleef ( a game made by SethBling), you are allowed to start a game only if there are 2 or more players on the server. How do I detect how many players are on the server in a similar way?
1
vote
1answer
263 views

Minecraft - Implement Random Access with Redstone

I'm trying to build a machine in Minecraft that will act similarly to an array. It will be implemented using physical blocks, not using a traditional redstone CPU type architecture of redstone signal ...
4
votes
1answer
692 views

Creating Quests with Command Blocks: Problem Testing Unset Objectives

I've got a Realms server, and I'm trying to create a series of quests that people can complete to up their overall "Defender of the Realm" score. However, I only want them to be able complete each ...
2
votes
1answer
646 views

How to build a command block machine that only allows YOU to be in a certain cord

i have been trying this: hopper clock on here and then comparator testfor @a[Dr_Weasel99!=DR_WEASEL99,r=5] then if player is found in my place again, a comparator /tp @p[Dr_Weasel99=!Dr_Weasel99] ~...
4
votes
3answers
39k 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,...
0
votes
1answer
301 views

Playsound when a player leaves and area but not when they enter

I've got a sound paspawn and want to play it when people exit an area but not when they enter or teleport into it. The sound should only be played once.
1
vote
1answer
4k views

How to use the summon command from server console

I haven't found the answer to this. Can I summon an object in Minecraft from the Server console? I have the exact coordinate where I'd like an item to appear and I want to type the command from ...
2
votes
1answer
6k views

Is there a way to keep potion effects when you die?

Is there a way for a specific player to keep the potion effect when he dies? For example, my friend and i are playing, with both a different potion effect. But when i die, i have to get that potion ...
6
votes
3answers
3k views

How to setblock snow_layer only if block below is a full-block?

Or is there actually any way to do that? Basically I do a /setblock ~ ~ ~ snow_layer at the player but if it's above something that snow layer can't be on (eg. slab,sign,grass) it just looks buggy. :/...
-4
votes
3answers
495 views

Can I use inequality in command-block testfor arguments?

I know there is the basic /testfor @a[score_HEALTH=1,team=red] but I need the "less than" argument. How can I denote inequality, as in @a[score_health<20] instead of =20? when I do score_health&...
0
votes
1answer
5k views

How do I teleport an armor stand to an item?

I am designing a redstone mini-game, and I need the game host to be able to set spawnpoints. I was thinking that the host would drop an item (say red wool) and an invisible armor stand named "Red" ...
1
vote
1answer
1k views

I'm trying to /testfor a player on a block

I am trying to make a command block that when a player walks over a block, it will detect the player and activate another command block with a different command. I tried: /testfor @p {coordinates of ...
3
votes
1answer
5k views

How can I search for a specific item with attributes?

I want to test if a player has the following item: minecraft:bow 1 0 {display:{Name:Bow I},ench:[{id:48,lvl:1}]} A bow with a name of "Bow 1" and has a Power I enchantment. I know this command ...
3
votes
8answers
115k views

Set facing direction using commands?

Is there a way to set the direction you face when you set a new spawn or teleport to a new location? For example, if I create a notice board in the spawn location facing north, and every one keeps ...
2
votes
2answers
205 views

Minecraft Command Entity Spawning Problem

I want to spawn an entity using an command but I can't. For example, I type in /spawn pig and nothing happens. Am I doing something wrong or is my computer messed up?

1
85 86
87
88 89
91