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
0answers
3 views

How to target player with the lowest health?

How to target the nearest player to me with the lowest health by using command? I believe it is going to do something with health scoreboard.
2
votes
0answers
24 views

How to teleport Minecart with chests above a players head?

I've been having trouble making menu GUIs in 1.16. My best idea so far was to create a command making it so when ever there is a nether star in my inventory it teleports a minecart with a chest in it ...
3
votes
1answer
26 views

How can I make only certain blocks of the same type breakable?

I am creating an adventure map, and am experimenting with using the NBT tags CanDestroy and CanPlaceOn to control which blocks a player can place/break. I have already made a pickaxe that can mine ...
1
vote
1answer
22 views

How can I set a player's scoreboard score to a player's coordinates [1.15.2]

I am creating a map in Minecraft Java Edition 1.15.2. I would like to be able to get the X coordinate of a player and store it in a scoreboard value. How can I do this?
3
votes
1answer
29 views

Is there a way to put spaces in a scoreboard player name?

This was a bit hard to give a name to (since it's just really hard to explain, if there is a better title for this question, then go ahead and change it via an edit). Note that this is only focusing ...
0
votes
0answers
27 views

How to target the player who kills another player with a custom snowball?

I made a custom snowball that can give instant damage effect when it is thrown near a player which makes it appears to be like the snowball actually deals damage to player. I want to add up the score ...
0
votes
1answer
23 views

How can you detect when a player is looking at an entity in Minecraft Bedrock?

I'm trying to detect when a player is looking at another player to re-create Dream's 'Speedrunner v Assassin' video with GeorgeNotFound, in which if George looks at Dream, Dream becomes frozen. I ...
0
votes
2answers
29 views

Is there a way to find the NBT of a player head?

Let's say I have the head of a player by the name of "Player" (creative, I know). If you have the physical head in your inventory/stored somewhere/in your possession, and that head has the ...
0
votes
0answers
17 views

How do I continue a data pack function even when a command fails?

I am very new to data packs, and while messing around with /execute I ran into a problem. As of 1.16.1 there is no "else" subcommand for the /execute command, meaning I have to do something ...
1
vote
1answer
28 views

Can you make a repeating command in minecraft with /data command, that only affects any entity once?

I am trying to make a command block command for server I am playing at, that would make any creeper near it not explode. As they still somehow spawn where they shouldnt and keep blowing up behind ...
0
votes
0answers
25 views

How do I /kill a specific item on the ground with CustomModelData?

I m trying to make it so that some specific items would be undroppable. Im trying to do this by killing the "undroppable" items when on the ground. I know that /kill @e[type=item] would kill ...
4
votes
0answers
43 views

Ender Dragons spawned with commands center their behavior at (0,0). Can this be changed?

I'm trying to create a 1.16.1 adventure map which includes an Ender Dragon boss fight. I've figured out how to summon a dragon in the Overworld that isn't passive, but the problem is that the dragon's ...
1
vote
1answer
30 views

How can I target the same player that was previously targeted randomly?

I am making a Minecraft commands map and need to give a random player two effects and one item. I understand that each effect/item needs to be given in a separate command. The problem is, @r targets a ...
1
vote
0answers
19 views

How do I make fire form if a specific splash potions lands?

Title says it; I need a splash potion that works like a molotov, I need this to be in vanilla and any help is appreciated!
0
votes
1answer
34 views

How to tell if a certain item is in a player inventory [duplicate]

I am trying to create a challenge world where a certain item (e.g. netherite sword) must be collected. How can I check automatically if a player has it (using commands), and then congratulate the ...
-1
votes
1answer
33 views

minecraft player detection between 2 points [closed]

So I am working on a minigame server and i need to test for ALOT of areas in the world and when players fall into them. I'm trying to use the relitave x~ y~ z~ for this but in this command: execute if ...
-1
votes
0answers
10 views

Can i use items as bullets in crackshot plugin?

I searched out the crackshot plugin configurations and everything and there is an item id option to add as an subtype to the bullet but it doesn´t seem to work, the bullets are snowballs but i wanted ...
1
vote
0answers
29 views

How do you convert a custom-item /give command into a villager trade? (in general) [duplicate]

I know this is similar to many other questions out there, but I just wanted to ask not only how to convert a custom-made item into a villager trade, but also if there is a general way to convert said ...
2
votes
1answer
28 views

Why does my /tellraw throw an “Unterminated string” error?

My server is version 1.16.1 and I'm trying to run the command: /tellraw @a ["",{"text":"Co-op >","color":"aqua"},{"text":" [PIG"...
2
votes
1answer
105 views

Is there a way to reward Items based off scoreboard points?

I am making a server based on PVP and I have set up a scoreboard that displays a players kills. I was wondering if, say for example, a player reached 50 kills could I give them a reward? (e.g diamond ...
2
votes
0answers
13 views

What order are target selector results returned in if the sort parameter is set to “arbitrary”?

Target selectors are used to select certain entities. They accept different arguments to choose which entity to select. Usually, this returns a list of found entities. Using the limit=n parameter ...
1
vote
2answers
37 views

How do I invert the /testfor command's result? (1.12 and below)

/testfor, /testforblock, and /testforblocks are all part of the same group of commands and are similar in what they do after their test. They are only useful when their output is measured using ...
-2
votes
2answers
66 views

How do I get back to the overworld?

I accidentally used /spawnpoint in the end in Creative Mode. Now, I keep respawning in the end, and my end portal won’t send me back to the overworld. What can I do to get back?
0
votes
1answer
17 views

Is there any way to change a non-player entity's data in Minecraft 1.7.10?

I need this rather old version for an experiment which likely doesn't work in newer versions. Unfortunately, the /entitydata command was added in 1.8 (and the /data being even newer. Is there any way ...
-2
votes
0answers
31 views

How do I change my player's max health in Minecraft using /data merge entity? [closed]

I want a command to change my max health that isn't based on /effect give
0
votes
1answer
35 views

How do I use command blocks to check the scoreboard for one player remaining?

Im trying to make a world where survivors have to live for 5 minutes, or the "Hunter" has to kill all the survivors within 5 minutes. Im using an xp timer for the clock, so all im stumped on ...
1
vote
1answer
36 views

How can I run a command if one or more conditions in /execute are satisfied?

In Minecraft 1.16.1, I’m trying to make a system thats detects when one of several fake players doesnt have a specific score. Here is my first attempt: execute unless score sticks_have page-2 matches ...
1
vote
0answers
23 views

What is causing some custom sounds to not follow the player?

I'm working on an adventure map in Java Minecraft that requires sounds to be played to the player. These sounds should follow the player around such that the origin of the sound is the player ...
-1
votes
1answer
36 views

Can't get item with lore or custom name

I am trying to give myself an item with a custom name as well as some lore. I tried /give <my username> tripwire_hook{display:{Name:"{\"text\":\"Dungeon Key\",\"...
0
votes
1answer
75 views

How can I allow players to view inside of a chest without being able to take out items? [closed]

I am working on a trading system between two players with command blocks, and I want to use a chest as an intermediary. I want players to be able to see the contents of the chest, and hover over items ...
-2
votes
0answers
20 views

worldedit in command blocks

I'm trying to use worldedit in a commandblock to randomly change colored concrete. I've tried using this command: //pos1 81,69,-72 //pos2 -75,64,-72 //set 10%minecraft:red_concrete_powder,10%minecraft:...
-4
votes
1answer
39 views

Command Block Works then Stops Working [closed]

I play Minecraft Java Version 15.1.1 on a good-specs PC. I've been trying to figure out how to use command blocks but I don't know what keeps going wrong. I'm putting the Command Block well and good ...
-3
votes
0answers
32 views

How to add Prefix and Suffix to my custom Spigot plugin? [closed]

I have recently started work on a plugin with a good few commands, but was unaware of how to add prefix/suffix commands (e.g. /prefix, /suffix). I have scoured throughout the web with multiple search ...
2
votes
0answers
11 views

How can I execute when a certain player hits something in minecraft

I am aware that you can execute a command when a mob is hit, and utilize that command in my map, but I would need to know the player or team that it was hit by. I am making a tennis map where the ...
-3
votes
1answer
30 views

How do I give Mobs an effect (or multiple effects) when they trigger a pressure plate?

I have a room for mobs with a pressure plate inside. When mobs stand on this pressure plate, I would like for them to receive the Invisibility effect and the Slowness III effect, for 60 seconds each. ...
-3
votes
0answers
34 views

how to make a half heart in minecraft 1.15.2? [closed]

How can I make half a heart in minecraft 1.15.2 with the help of a command? And return back 10 hearts with help command
-1
votes
0answers
33 views

How do I set up the command to check how many mobs a player has killed to play a redstone block?

So I have been working on this map in Minecraft in a 1.12.2 server. It is mostly done. I'm trying to set it up so when a player kills 10 of each mob in each room a redstone block is placed opening a ...
1
vote
1answer
27 views

How do I get the Kill command on a command block to work?

I know this question has been asked a lot, but none of the answers fixed my problem. I am using education edition, by the way, so maybe that is why. Anyway, I plug in the /kill @p command to my ...
-1
votes
0answers
26 views

How do I kill a player with a certain item in their inventory in Minecraft Bedrock Edition? [duplicate]

I'm trying to make a certain item kill a player when he already has that item in inventory. I've done something like that in Battlefield 1 where the tunnels were in paschendaele the peacekeeper ...
-2
votes
0answers
22 views

How can I have only one item of a specific sort in the server?

I'm making this game, and it has items, the thing is, you need to hold one item, do something with it, and then put it back. I'm trying to prevent people from leaving with the item in their inventory ...
0
votes
1answer
26 views

Schedule only when called in 1.16 rc1?

The first time I'm using /schedule but when I try to call a function using schedule from my main function it only works if I schedule it with 1 tick essentially just calling the function. I just ...
0
votes
1answer
24 views

Is it possible to level up a 1.15 villager using commands?

Is it possible to level up villager using commands like this: /data modify entity @e[type=villager,limit=1] merge value {level:4} (which doesn't work)?
1
vote
0answers
37 views

How to Fix Minecraft Server has 60 Wrong Located Chunks

My server crashed when I was running something else with java. Once I reload it, many of the chunks around spawn are misplaced. Is there a way to automatically (or manually) move the chunks back in ...
-1
votes
1answer
22 views

How do you get a note block with an NBT tag so when I place it or /setblock it, it will have a specified note or instrument

I am making note block songs and I want an easy way to set the notes on note blocks. How can I set a note block’s instrument or note in my /setblock command?
2
votes
1answer
23 views

How do I include a selector in hover text in /tellraw?

I currently have a problem with /tellraw. If I want to display a selector (@s, @p, ...) in a normal text, I always use {"selector":"@s"}. But now I want to display a selector in a ...
1
vote
1answer
18 views

Why is my worn item detector not working? (1.15.2 Minecraft)

I have worked on creating an item that can make you fly by sneaking but the detector is consistently failing. It is a scoreboard system and this is the item NBT: leather_boots{display:{Name:"[{\&...
1
vote
1answer
38 views

How can I number players returned by a target selector?

I would like to test for players in a certain area and number them. A target selector always returns a list of selected entities in the order of the sort parameter. For example, the following target ...
1
vote
1answer
38 views

Minecraft mid-command delay for 1.15.2

How do you put a delay in the middle of command? I'm making a TNT run (without TNT) and my issue is, when you start TNT run and you start jumping, sometimes a command block will register the block ...
0
votes
1answer
38 views

How do I force a player turn his head when i hit them?

Is there anyway that can force a player that I have hit to turn his head upward? I try to create something like an uppercut in 1.15.2 minecraft multiplayer server. I believe it is related to ...
5
votes
2answers
107 views

Is there any way in Minecraft to detect who deposited a diamond into a chest using command blocks?

So far, I've been able to detect when a diamond is placed into a chest's inventory but how can I detect who placed that diamond? I'd prefer not to use the nearest player because someone else could ...

1
2 3 4 5
74