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
-2
votes
1answer
52 views

How can I change the Game Mode of specific players? (in Minecraft 1.12) [duplicate]

I'm creating a Death Race map and I want to make sure only "OP's" can stay in Game Mode 1 and all the rest of the players stay in Game Mode 2 (in Minecraft 1.12) I tried to leave a Command Block ...
0
votes
0answers
18 views

How do I make hostile mobs ignore players [duplicate]

ive looked it up but the advice seems to be outdated, im trying to make a change to a map to allow players to fight alongside of vindicators in 1.13.2 but I want the vindicators to not kill the ...
-3
votes
1answer
47 views

How do I kill entities at y=65?

Potions can survive at y=65 One potion was thrown into the void, but instead of being killed, it just lingered there. Any ideas to kill it? I can't just run /kill @e[type=!player,tag=test1] (yes, ...
1
vote
2answers
147 views

Are there any commands that checks the weather? (1.14.4)

I am working on a datapack and I want to check if the weather is rain, thunder , or clear. Is it possible to check the weather using only commands?
1
vote
1answer
52 views

Excluding people from an effect

I own a Minecraft factions realm in pocket edition and want to make it so players cant grief people’s bases. I have already set up a repeat command block that goes like: effect @a[r=20] ...
2
votes
1answer
46 views

Detecting the dimension where a player is

I want to check a player's current dimension using a scoreboard. For example, if a player is in the overworld, scoreboard would be set to 1. Nether would be 2. And the End would be 3. I have tried ...
0
votes
1answer
99 views

How do I make a scoreboard command that detects when a player crouches in multiplayer?

In Minecraft 1.13/1.14, I start with some commands that work for singleplayer like: /scoreboard objectives add Sneak minecraft.custom:minecraft.sneak_time /execute as @a[scores={Sneak=1..}] at (my ...
0
votes
1answer
198 views

How do I teleport a player to a random position?

I need a random number from -100 to 100 for a command block /tp @p (random number 1) 200 (random number 2)
1
vote
2answers
210 views

Location based gamerules on Minecraft Realm (1.14.4)

Me and a bunch of buddies have a minecraft realm and have access to the nether too. We don't have any gamerules changed at this point but I (as the owner) got some complaints about losing items in the ...
7
votes
2answers
1k views

How to calculate player health percentage?

I have created the following objectives: health - health health1 - dummy (used for health*100) healthPerc - dumny (used for health1/20) The only problem I'm having is that when I do: /scoreboard ...
1
vote
0answers
49 views

How to make ranks in MCPE 1.13 [closed]

I’m an owner of a Minecraft Factions Realm and would like to create ranks, such as default, lord, owner, etc. After watching millions of tutorial videos I still cannot find a way to have prefixes in ...
0
votes
0answers
25 views

How would I remove an exact amount of named items from a users inventory on MCBE? [duplicate]

I'm trying to remove exactly 5 sunflowers from a user's inventory, and if they have less than 5 the transaction will not go through, I know a long way of doing it, but the ammount of command blocks is ...
1
vote
1answer
136 views

How to lock slot interaction to armor stands?

I have tried all i could possibly think off , there is a tag for locking slots but it does not work, i tried locking all slots, only weapon slots but it wont work, as soon as i click the armor stand i ...
0
votes
1answer
23 views

Use the /testfor command with scoreboard, don't want to use @p or @a [duplicate]

I've been trying to make a Minecraft shop but I only want myself accessing it, I've tried multiple variations of: /testfor (nameofplayer) {score_ka1:1} (ka1 is just another objective for amount of ...
0
votes
1answer
41 views

How to detect if multiple players have the same scores?

This is my command, it should only activate if all players have avance score on 0: /execute if entity @a[scores={avance=0}] I thought that with @a it would only be true if ALL players have that ...
1
vote
1answer
42 views

Team command doesn't work in functions

I'm trying to make a function, that when run, swaps the teams of two armor stands. I have this code written in a function on a repeating command block to set up the swap function, and the "less_num1" ...
0
votes
0answers
68 views

Detect player in square radius relative to command block

the command i am using right now is this one: /execute positioned ~ ~7 ~ run execute if entity @a[team=Player01,distance=..5] the problem is that the área is not a square, so it does not detect the ...
0
votes
1answer
65 views

Execute at coordinates relative to command block

I'm creating an RPG map and I need a command block to detect if a player is near specific coordinates, but I cannot work with specific numbers, I need it to be relative to the command block position. ...
1
vote
1answer
388 views

How to teleport nearby villagers to me? [duplicate]

I want to move all my villagers back to the middle of my town. I'm trying to work with the /tp command, but almost every time it says Entity not found. /tp @e[type=minecraft:villager,dx=300,dy=300,dz=...
-1
votes
1answer
87 views

How to summon an item frame with a custom name item in it? [1.14]

I'd like help with a certain command that spawns an 'item_frame' with an item that has a tag in it. I have already tried: /summon minecraft:item_frame ~ ~ ~ {Facing:1,Item:{id:"minecraft:melon_seeds",...
-1
votes
1answer
241 views

Minecraft loot table 1.14.4

I am in need to the answers to the following questions about loot tables in 1.14.4. What is the command to spawn in your custom loot table chest Wheres the directory to put the custom loot table in ...
0
votes
3answers
8k views

Is there a way to /give an arctic fox spawn egg in Minecraft?

Is there a command to /give myself an arctic fox spawn egg?
0
votes
1answer
26 views

Would someone give an explanation of how to modify the data of a fox?

Using Minecraft 1.14, I would like to use the /data command to change a baby fox's age. There are three other foxes in the world, and I would not like any of them changed or modified. I've been trying ...
0
votes
1answer
34 views

How do you use the /testfor command in 1.5.2? [duplicate]

I play in 1.5.2, and right now I'm working on using commands. I see that there's a /testfor command when I write /help, but what does this even mean? What is it and how do I use it? Edit: This ...
-2
votes
1answer
59 views

Let a specific mob follow another mob

I was trying to make a horse follow exactly 3 blocks behind the horse that I am riding on. I can do that by using teleport command and the new parameter ^^^, but the result sucks as when I look up,...
-1
votes
2answers
44 views

How to clear hostile mob drops only [duplicate]

I have a set up to kill all hostile mobs the minute they spawn on my server, should I just always have a /clear kind of command running? Or is there an alternative way to make it so people can get ...
-1
votes
1answer
78 views

How can I teleport every entity below Y=0 to Y=255 in Minecraft?

How can I teleport every entity below Y=0 to Y=255 in Minecraft? I'm making Skyblock, but I want falling out of the void to teleport you to the height limit.
1
vote
0answers
38 views

Changing donkey inventory item data doesn't update immediately

I am in Java 1.14.4 and I'm trying to create a custom crafting system using donkeys. ATM I am adding the ability for the items in the crafting grid to subtract their count whenever an item has been ...
1
vote
1answer
74 views

How to replace a helmet slot with a player skull

So I'm trying to swap the helmet slot of an armor stand from one player head to another in Minecraft 1.14.4. One head is obtained from minecraft-heads.com, and the other is a real player's head. When ...
-1
votes
1answer
31 views

Detecting an empty hand (1.9)

So I'm making a map for version 1.9 and one of its core mechanics, is that if someone is holding an object in hand, they get a certain effect (speed, jump boost etc.) and I'd like the effect to come ...
0
votes
1answer
77 views

How do I detect if more than 2 players are online with command blocks? [duplicate]

In Minecraft 1.14.4, I and my friend want to make a custom map and we need to detect if there are at least 2 players online with command blocks. Is there any way to do that?
2
votes
1answer
56 views

HandDropChances and ArmorDropChances set to 0.0F doesn't work

So i'm trying to summon a mob with items in hands and on body but i don't want it to loot this stuff when killed. I want to manage the loot via a death loot table. Here is my command : execute at @p ...
-3
votes
1answer
62 views

Can blocks in Minecraft have right-click actions, such as tossing an ender pearl?

So I've been trying to make the Space Stone from the Marvel universe and I would like to know whether it's possible to make it so that when I right click a block of blue glazed terra-cotta, an ender ...
0
votes
1answer
106 views

How do I detect if a player is standing on a specific block? [duplicate]

What I want to do: Detect if the player is on black concrete, and then change a scoreboard I created called reviveto 1. I'm in 1.14.4, and I can't find tutorials online for this. I assume that the ...
-1
votes
2answers
47 views

Issues with running a data merge within an if command

I've spent a few hours on this and looked around on the minecraft wiki and I cannot work out how to go about this. The aim is to add motion to a minecart a player is riding in when looking in a ...
1
vote
1answer
876 views

How can you view the contents of another player's enderchest? [1.14]

I think you can use /execute as <selector> run replaceitem entity @s enderchest.0 minecraft:stone to change the contents of someone's enderchest, but that doesn't really show you the contents ...
-1
votes
1answer
30 views

Detect block over players head

I need a command to detect if a block is over a players head. I have only found commands to detect if the block is under a player. Do anyone have a command to detect blocks over players heads? :)
0
votes
2answers
96 views

How do you make items unbreakable? [duplicate]

I really want to know how to do that
0
votes
1answer
52 views

How to get command block talking in chat to nearby players?

I'm trying to get a command block to write in the chat, and it is working, but it is displaying it to all players in the server. I only want the chat to appear to the player that steps on the pressure ...
0
votes
1answer
36 views

How to detect what mob hit a player 1.12

I'm making horror map. And i got some problems. I need that when a player takes damage from a specific mob, a block is placed. This block will start another system. For example: if player have damage ...
1
vote
0answers
27 views

How do I spawn a zombie with the closest player's name MCPE [duplicate]

So I need to have a zombie with the closest player's name but I don't know how to do it anyone that can help? I think it would be something like this: /summon zombie ~ ~ ~ {name:@p}
4
votes
1answer
50 views

Is there a way to lock head rotation? 1.14.4

I was doing some stuff in my single player world and I wanted my head to always look down, but not making it choppy. You could do execute as @p at @s run tp @s ~ ~ ~ ~ 90 in a repeating command block,...
3
votes
2answers
184 views

How to summon an invisible entity upon spawning?

I'm trying to summon a slime that is invisible when you summon it, but whenever I run the command below, the slime appears for a half a second and then disappears. /summon slime ~ ~1 ~ {NoGravity:1b,...
1
vote
1answer
54 views

How can I convert my custom give command to a Minecraft villager trade command?

I just made a command for an invisibility potion that lasts 25 seconds. (3 min is way to long for the mini-game I am making.) Here is the code: /give @p minecraft:potion{CustomPotionEffects:[{Id:14,...
1
vote
1answer
149 views

How to detect if an arrow hit a red wool block in 1.14?

I need to test if an arrow hit a red wool block in a Minecraft 1.14. I'm using the following command: execute if entity @e[type=item,nbt={Item:{id:"minecraft:arrow"},inTile:{minecraft:red_wool},...
0
votes
1answer
57 views

How do I test if an entity’s score = 0? [duplicate]

I am making a hide & seek scoreboard countdown for a friend of mine's hide and seek game. I want to ask how do you use /execute to test if an entity’s scoreboard is equal to 0? I have an armour ...
1
vote
2answers
382 views

Is there any way to teleport someone to the nether? (1.14)

I wanted to try to make a new dimension, by teleporting them over the bedrock in the nether. /execute as AaronKanaron in minecraft:the_nether run tp @p ~ 128 ~ I know I've done something wrong but ...
-2
votes
1answer
103 views

I don't get the nausea effect anymore

I'm playing on v1.14. It's weird, I don't get the nausea effect anymore, I've tried restarting the game and removing the texture packs that were on. Does anyone know a fix? Video I was using this ...
3
votes
3answers
191 views

Filling every air block above a specific block in a specific area

I want to spawn-proof the main island in the End by filling every block above (only above) each End Stone block (only if that block is air) with White Stained Glass in a specific area. I have OP and ...
0
votes
0answers
50 views

How do I replace all blocks of one type to another block using commands? [duplicate]

I am building a house with a glass roof and I ended up making another floor, and I don't want a glass floor. I need a command to replace all the glass to birch planks. I have looked at some other ...

1 2 3 4 5 67