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.

Filter by
Sorted by
Tagged with
38
votes
2answers
1.6m views

Keep items in inventory on death in Minecraft

I once played a vanilla Minecraft adventure map (called "Herobrine's Mansion") that prevented the player from losing their items on death. Which commands can be used to prevent the player from losing ...
36
votes
1answer
5k 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?
34
votes
3answers
8k views

Is it possible to create food allergies in Minecraft?

The idea is that a certain number of random people on the server are identified to have a food allergy - let's pick wheat for an example. Then, when those players eat any item that contains wheat (...
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?",...
24
votes
5answers
232k 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 ...
23
votes
3answers
24k views

I have little fighting skill. How can I get rid of a Wither?

I have set up a Minecraft server for my 5-year-old son and a friend of his. They use it in creative mode to build stuff. Today, my son copied instructions he saw in a YouTube video and created a ...
21
votes
3answers
66k views

What does turning off mob griefing actually do?

In Minecraft, there are several commands that can be employed to make the game a little easier, without actually affecting the difficulty, such as /keepInventory and /mobGriefing. However, what does /...
20
votes
5answers
9k views

How do I kill mobs using /kill without them dropping loot?

I have a spawn area I am hoping to make a safe haven, so I have a command block on a clock that kills each hostile mob type. This works to keep the place free of any hostile mobs, however every night ...
19
votes
5answers
131k views

Is there an SMP Server Command to change weather conditions? [duplicate]

The latest version of Minecraft (1.5) brings, among other things, a number of different weather conditions. Most of these annoy me to no end. I tend to spend a lot of time playing on an SMP server, ...
19
votes
2answers
4k 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 ...
18
votes
2answers
68k views

How to disable command block logging into the log files in minecraft

Hi, I have a single player world which is opened to LAN to let my friends play while I am AFK. I have a lot of command blocks running in that world and those commands are all logged in the log files. ...
17
votes
4answers
9k views

How can I block people from my Minecraft world?

Every time I open my world to LAN, people join and start destroying stuff. I want to ban them, but every time I ask someone for help they can't ban them.
16
votes
1answer
11k 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?
15
votes
3answers
69k 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. ...
15
votes
8answers
26k 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 ...
15
votes
1answer
3k views

What's the difference between tp and teleport?

Snapshots for 1.10 introduced teleport command feature for /execute. What is its difference to the current tp? I heard it has something to do with "relativity" (~)
15
votes
9answers
7k views

How to add an enchantment onto held item in Minecraft with command blocks

I want to have a button to enchant a piece of armor in my hand with Unbreaking V, if and only if: The tool is already enchanted witch has Unbreaking III The player has a minimum of 30 levels I tried ...
14
votes
5answers
527k 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 ...
14
votes
4answers
416k views

How do you enchant and name items with /give using command blocks?

How do you enchant and name items with /give using command blocks?
13
votes
3answers
45k views

How can I easily find structures in Minecraft?

I would like to find and explore some Minecraft structures, like Temples, Dungeons and more. My current way if finding these is to go straight and look around while walking. This isn't very efficient, ...
13
votes
8answers
21k views

How can I use Command Blocks to keep players from placing blocks on a vanilla server?

I want to know how to keep players from placing blocks in a certain area on my Minecraft server using Command Blocks. I already know how to keep them from breaking anything via [effect player 'mining ...
12
votes
2answers
2k views

Can online servers read my /minebot commands?

I have a mod on my game (1.7.10), which allows me to automatically kill animals, mine and farm. To activate it though, I must type in /minebot kill or /minebot plant wheat Can the online server ...
12
votes
4answers
11k views

Seconds to ticks conversion

I am building a fnaf map for me and my friends to play, and need to convert seconds to ticks. I read on the wiki that a night is 8m 36s, which is 516s altogether. I want to convert 516s to game ticks....
12
votes
3answers
109k 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 ...
12
votes
1answer
59k 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:"...
12
votes
5answers
3k views

How would I make something spawn when and where a snowball hits something?

I know how to make things spawn as they follow an object, but is there any way to make them spawn once lets say a snowball hits its target? I am working on a way to make snowballs that spawn tnt upon ...
11
votes
2answers
1k views

Is it possible to make a Player go only backwards?

I'm making an Adventure map (it has loads of command blocks), but I got stuck: How can I make a Player to be able to go only backwards, that is, only when pressing the 'backwards' key, and to be ...
11
votes
7answers
15k 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?
11
votes
4answers
3k views

Detect *where* a specific player died?

So I am making a capture the flag game. I have a objective for picking up the flag: /scoreboard objectives add red_flag stat.mineBlock.minecraft.wool Has the red flag I want it so that when a ...
11
votes
2answers
38k views

How do I spawn wolves?

How do I spawn wolves in singleplayer Minecraft using Single Player Commands; what command do I use?
11
votes
1answer
891 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'...
11
votes
2answers
4k views

Minecraft command block logging

I had just updated my friend's minecraft server to the beta build of bukkit (1.4.6 R0.1). This restored all of the plugins that weren't available when it was vanilla. However, the internet (and its ...
11
votes
3answers
33k views

How do I choose what horse I spawn?

There are summon commands for mobs in Minecraft, ie; /summon EntityHorse ~ ~ ~ {Type:4,Tame:1} Summons a Tamed Skeleton horse with full health. So my real question here is: What are the specifics ...
10
votes
1answer
2k views

How to hide the [@] in a Minecraft command block

As most Minecraft command blocks makers know, if we use the /say command to output text, this will happen: [@]Lorem ipsum The [@] is actually very annoying, how can I remove it?
10
votes
2answers
9k 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 ...
10
votes
4answers
8k 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 ...
10
votes
2answers
970 views

Detect lightning strikes

I'm trying to add some custom mob conversions like those of villagers/witches and pigs/pigmen (but here it is a block that turns into an mob, not a mob to a mob). What I can't seem to figure out about ...
10
votes
1answer
553 views

Elytra mechanics in Minecraft

My goal is to use ArmorStands wearing elytra for ray casting. So far I figured out how to make it travel horizontally in any direction. But my problem is that the speed of the entity changes and it ...
9
votes
4answers
373k views

How do you clear all item drops in Minecraft?

How do you clear all item drops in Minecraft? I want to have something activated by an Item landing on a golden pressure plate, but It can only be activated once. Is there any command block command ...
9
votes
3answers
14k 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:"...
9
votes
3answers
3k views

Do Minecraft functions have inputs and outputs like conventional functions?

Now I know that technically in theory one could just use blocks to convey values in and out of any body of code. What I'm asking is whether or not a built-in syntax exists for input parameters and ...
9
votes
4answers
391 views

How can I test my command block contraptions for multiplayer compatibiltiy?

I like making command block contraptions. Occasionally, I make a contraption that I want to use on a multiplayer server (or offer to server operators), but I don't know of a way to test that it'll ...
9
votes
3answers
3k views

Detect if player clicks with item such as stick or blaze rod?

how would I detect if player clicks with item such as stick or blaze rod? I suppose this would use scoreboards? I also can not use comparators or such, it will all be hooked up to a clock, although ...
9
votes
4answers
4k views

Automatically running a Minecraft command

Is there a way to automatically run a Minecraft command when starting a new game, loading an existing world, joining a server, or re-spawning? For example, is there a way to automatically enable ...
9
votes
2answers
607 views

How can I swap two inventory slots dynamically?

I would like to use command blocks to swap the contents of two specific inventory slots dynamically, while retaining the item, data value, and stack size. I know it is possible to set a slot to ...
9
votes
2answers
287 views

Minecraft 1.12 reliably detect player-player interaction

I am making this command block mini-game which requires two players to "interact" with each other. With interacting, I mean: two players meet each other, initiate the interaction, then command blocks ...
8
votes
3answers
29k views

Can I have extra minecraft inventory?

Can I have extra Minecraft inventory in vanilla Minecraft? I have seen mods be able to do this but never in vanilla Minecraft. Is there some way for me to carry more. Maybe a command that allows ...
8
votes
2answers
10k views

How to /testfor a player's gamemode

I've recently had some difficulties finishing a system; in fact, I need to /testfor myself if I'm on spectator mode or another gamemode. Because I didn't know what to write, I tried this, but it didn'...
8
votes
6answers
33k 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 ...
8
votes
2answers
634 views

(Java Minecraft 1.14.2) How to recursively (or otherwise) determine if a closed 2D arbitrarily sized rectangle of blocks has been placed?

The title is a little complex, so let me explain it more fully. I am writing a datapack where I want to be able to run some commands if there is a rectangle of iron bars placed which is complete. I ...

1 2 3 4 5 67