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
0
votes
1answer
42 views

What am I doing wrong?

/give @p diamond_sword 1 0 {ench:[{id:19,lvl:2000},{id:16,lvl:2000}]},display:{Name:"The Destroyer 2000",Lore:["The Sword That Beats All!"]}} This is my command and it doesn't work. I'm just trying ...
5
votes
1answer
2k views

How would I go about making a custom minecraft item that triggers events when it's used?

In specific, I'm looking to code a sword that, when used to block, advances the time of day by 4800. Hopefully this can be accomplished with command blocks only, as I'd rather stick to vanilla ...
2
votes
1answer
946 views

Knock a player off of a block

I would like to knock players back, whenever they step on a block. I have tried making a fill clock doing the following commands execute @a[x=-124,y=67,z=1307,r=0] ~ ~ ~ /summon Zombie ~ ~ ~ execute @...
0
votes
1answer
508 views

How does one use @e data on a custom named snowball

The below command does not work on a Snowball and I was wondering how to do it. execute @e[name=snowy] ~ ~ ~ particle smoke ~ ~ ~ 0 0 0 0.1 5
6
votes
3answers
3k views

How to make a worldborder that expands every in-game day at dawn?

I want to make a world with a world border that increases 2 blocks every in game day when the sun rises using command blocks. How would I accomplish this? I don't completely understand commands so ...
1
vote
2answers
791 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 ...
1
vote
1answer
122 views

Add half a hunger point?

How would I add half a hunger point to a player when they are in a certain area? I have got the detection part right I just don't know how to add exactly half a hunger point. Here is what I have ...
1
vote
1answer
245 views

How can I make a mob in which players can punch blocks through?

I am trying to make a sheep in which players can punch through, sadly I have had no ideas on how to do this. Does anyone know how or is it impossible in Minecraft's current state?
3
votes
1answer
117 views

How to create an object with a name of the nearest player?

Sorry for my English. It would be like /give @p diamond_sword 1 0 {display:{Name:@p}} but this obviously is not working. Thank You.
2
votes
2answers
199 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?
0
votes
1answer
593 views

invulnerability no longer working

im trying to make a mob that is invulnerable to all, yesterday on the same mc version I had the same command and it summoned a sheep that could only die to someone in creative mode with a diamond ...
0
votes
1answer
2k views

Command so that anyone within a radius who isn't me gets teleported?

I know [r=x] is to make a radius and you can do /tp @a[r=30] x y z to teleport someone everyone 30 blocks away but how can I do it so it excludes me? So let's say that me and two other people are ...
-2
votes
1answer
4k views

How can I add half a heart of health using command blocks?

How would I add half a heart of health to a player when they are in a certain area? I have got the detection part right I just don't know how to add exactly half a heart. Here is what I have tried ...
2
votes
1answer
5k views

How do I give an effect to all players that are not in the radius of 4 around my villager?

I have the command: execute @e[type=Villager] ~ ~ ~ effect @a[r=!4] 19 5 2 It should give poison to all players that are not in the radius of 4 blocks around my villager, but it does not work. Is ...
0
votes
1answer
439 views

how to not commence a command depending on player health? [duplicate]

I have a command that simply turns grass into dirt when a player stands on it. execute @p ~ ~ ~ detect ~ ~-1 ~ grass 0 setblock ~ ~-1 ~ dirt Is there any way to make this not happen when the player'...
1
vote
1answer
3k views

Summon a chest with enchanted items? [duplicate]

Everytime I try to use a command to do an enchanted item it never works and there's just a 0 next to the item. I tried to spawn a diamond sword with sharpness in a chest but instead in the chest there ...
1
vote
1answer
418 views

Minecraft executing on an entity not working

What i am trying to do is make an entity say hi when it is in a certain radius of another entity. I have used a scoreboard called PigProgress. What is happening is that I am giving a score of 1 to ...
-2
votes
1answer
1k views

How do I spawn a skeleton with enchanted leather armor riding a creeper? [duplicate]

I wanna spawn a skeleton with full leather with all MAX blast protection riding a creeper. And so the command I came out with is this: /summon Skeleton 16 53 -21 {Equipment:[{},{id:leather_boots,tag:{...
1
vote
1answer
1k views

Summon a PrimedTnt with a very long fuse

I would like to create a PrimedTnt with a fuse longer than the maximum (max fuse = 127 ticks). The fuse must be about 10 seconds. Thanks for your help. I have tried putting 2 command blocks on a 20hZ ...
0
votes
1answer
1k views

How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory?

I don't know how to put those two conditions together into one command. I tried /scoreboard players add @a{Inventory:[{id:"minecraft:iron_ingot"}]} [x=-506,y=56,z=-1176,r=1] Score 1 but it doesn't ...
1
vote
2answers
5k views

Using scoreboard objectives as arguments for commands

Is there any way to use scoreboard objectives as arguments for commands? For example, say I have a command block that should teleport a player to a location based on their score. tp Notch ...
0
votes
1answer
51 views

Select player not in a specific position

I am making an AFK machine where people go stand when they want to be AFK in vanilla Minecraft. So I am trying to detect players that is still in the AFK team (@a[team=AFK]) but not in the place where ...
2
votes
1answer
1k views

Making a horse ride-able by only one player in vanilla Minecraft

I run a 100% Vanilla Minecraft server, and would like to have Undead Horses that only Moderators are able to use, but I'm not sure about how to do this. I've tried to use CustomName data tags when ...
2
votes
2answers
321 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.
4
votes
1answer
10k views

Testing for a player with a certain score finds any player no matter what their score is

I have an objective called ninja, which can either have a score of 1 or 0. The command I am attempting to use is /testfor @p[score_ninja=1] However, the command returns "Found (my username)" rather ...
3
votes
1answer
432 views

Command Blocks and Redstone Comparators

So I am giving Command Blocks a first try and I've found that with the comparator you can make it so it perceives a player is near them (and of course if you use the [r=x] tag. The scenario I am ...
5
votes
1answer
1k views

Is there a way to determine whether a player is online or offline with command blocks?

I have some redstone circuitry in place (see attached image), involving a hopper clock, command blocks, and the scoreboard. The basic purpose is to play a sound with /playsound, and then once a ...
1
vote
2answers
5k views

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

So I know how to do /replaceitem but is it possible to do the command but instead of only doing one slot but multiple or even slot.container.x, x being that slot and continuing to the next slot?
1
vote
1answer
6k views

Summon 10 Zombies at players position, to all players

There is a way to summon 10 zombies near every player on the map with command blocks twice a day? In the official command wiki, we can read this: To summon 10 creepers at the nearest player's ...
1
vote
1answer
646 views

Minecraft - Teleport player on spawn

I would like to teleport the player instantly on spawning. I am aware of the /setworldspawn command. I would like them to spawn into a small building. I cannot make the building larger. Thanks for ...
1
vote
2answers
1k views

How do I use the /testfor command?

In Minecraft and in the answers I see stuff like this: /testfor @a[x=X,y=Y,z=-Z,r=R] Then the people say to hook it up to a /setblock command or a /fill command or etc. What do people mean when ...
2
votes
1answer
2k views

Minecraft - Add up teams scores

I am using the /scoreboard command. I have everything working, but I would like not only all the players indivisual scores on the sideboard, but also the two teams. I would like them to update ...
4
votes
2answers
4k views

Counting items in a chest

I am working on a system that allows a player to build a template building such as a house. Building one of these structures requires the player to meet a certain quota of required items. (for example ...
1
vote
1answer
190 views

How to clear only unnamed items

The title might be confusing but what I am trying to ask is say that you have two diamonds. One of them is named "Blat". How do I clear only the item that isn't named?
2
votes
2answers
902 views

I need help with this Minecraft Tellraw command, Issue at column 89

This command is still a work in progress, but I am having issues. It gives me an error message when I click "Check Balance" and the error message says: Invalid json: Unterminated string at line 1 ...
0
votes
1answer
2k views

Can I spawn ghast fireballs in vanilla minecraft?

I was watching side quest on Youtube, and they summoned a Ghast fireball. I noticed that they then punched it and went back in the opposite direction. Is this possible in Vanilla Minecraft?
0
votes
2answers
6k views

Can you make snowballs deal damage using command blocks?

I was wondering if it was possible to make snowballs deal damage to players and mobs, using command blocks? I'm playing Minecraft 1.7.10
2
votes
1answer
2k views

Custom Villager Summon Command

I am trying to summon a Villager that buys 64 Planks of any kind and giving you 1 gold nugget I have tried using /summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Wood_Buyer,Profession:0,Career:1,...
0
votes
2answers
606 views

Teleporting a player from one block to another

So the problem I have here is I want to teleport a player standing at 1 34 70 to 273 33 -5. I have tried using a clock with testfor @a [x=1.3,y=34,z=70] hooked up to a tp @p 273 33 -5 but when I go ...
-1
votes
1answer
185 views

Need help on /kill command an usage of @e [duplicate]

Hi everybody I need some help with minecraft. I an a command : /kill @e[type=!Player,ArmorStand] and it didn't work What I wanted : A command that kills every entity except ArmorStand and Players. ...
2
votes
1answer
594 views

How can I display stats like death count using titles?

I'm making a dungeon-crawler adventure map, and at the end I would like the system to tell the player, either within the chat or on screen (using /title) these criteria: Number of deaths Number of ...
1
vote
1answer
258 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 ...
-1
votes
1answer
694 views

How can I teleport a team but have each of the players go different places?

I am separating teams for a teleport system with tubes, I have 6 tubes and 2 teams of 3. How would I separate the players from their other teammates in teleporting? Here is a command: tp @p[team=...
1
vote
1answer
193 views

Problem with execute command in minecraft

I am trying to run this command: execute @a[score_hammer_min=1,score_shift_min=1,score_attack_min=1,rx=74,rxm=90] ~ ~ ~ /summon LightningBolt ~ ~ ~ I have tried changing the variables around and ...
1
vote
1answer
490 views

Check if area contains only one entity in Minecraft with a command block

Is it possible to check if an area contains only one entity with command blocks. I've tried /testfor, but it activates the redstone for one person, even if there are more...
-2
votes
1answer
314 views

Is there anyway to make a vanilla mail system?

What I want to do is that when someone has ran a command, a tellraw text runs a command and when you press it, you can type a message to one particular person, who's offline on the server you're on. ...
2
votes
1answer
2k views

I want the snow golem to do some damage to mobs, how can I set that on my server?

I want to use the snow golems to create some kind of "smart turret", but I want them to do damage when shooting. I don't want to use mods, I'd prefer a built-in solution if possible.
1
vote
2answers
2k views

I need to replace Grass blocks in super flat to red sand

I would like to change all the grass block s in the world to red sand with command blocks I was having problems with /fill. I am just starting to get used to commands and such so simple as possible ...
3
votes
2answers
7k views

How do I use /setblock and place a stone brick stair in the outer right shape?

I can't quite place a stair the direction I want it to go and I need to know the format of how to do that command. I have already attempted to do /setblock ~ ~ ~ minecraft:stone_brick_stairs 2 ...
2
votes
1answer
240 views

Is there a way that I can stop people from standing still too long?

I want to make a map where the player is not allowed to stand still in a certain radius of blocks (only sprint parkour, no stopping!) and if I search Google it comes up with how to create a AFK ...