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", "minecraft-bedrock-edition", or "minecraft-education-edition" tag.

Filter by
Sorted by
Tagged with
0 votes
0 answers
51 views

How to move the contents of a chest to a Bundle using commands?

I'm currently trying to move the contents of a chest into a bundle (being held by a placeholder armor stand) but the most it would do is copy the last item in the chest (that is not minecraft:air) ...
user avatar
  • 1
0 votes
1 answer
82 views

How to create a command block with alarm sounds

I have a prison map I am building, but need a command block that sounds like an alarm. Problem is, the command block starts getting choppy after repeating continuosly. Anybody have suggestions for an ...
user avatar
  • 3
0 votes
2 answers
41 views

How do I summon a layer of entities efficiently?

I am making a system of commands where trapdoors are traps, so whenever someone holds the trap in their hand, the trap happens to everyone. I already made part of the command for the birch trapdoor: ...
user avatar
  • 330
2 votes
3 answers
133 views

On Minecraft Bedrock Edition, how do I make it so people can't build at spawn?

I know using barrier blocks makes it so people can't break stuff, but how can I make it so players cannot place stuff at spawn?
user avatar
0 votes
1 answer
54 views

Teleporting an entity behind a player?

I am trying to make a morph command with command blocks but whenever I try to use ^ the mob just moves up and down when I try to move my camera. I can't figure out how to get the head to move while I ...
user avatar
1 vote
1 answer
115 views

How would I make a door "stun" a player

I am playing Minecraft Education Edition, and I want to know if it is possible for the door to stun a player. For example if there are 5 players I want 1 of them to be able to be stunned by the door. ...
user avatar
  • 1,097
1 vote
1 answer
32 views

How to restore armor stands?

I was building a map with a lot of custom armor stands and I accidentally used the /kill @e command. Is there any way I can restore my armor stands?
user avatar
0 votes
1 answer
28 views

Is it possible to summon entities similar to how the fill command works?

So I wish to know if it is possible to summon entities in the same way you would use the /fill command in Minecraft for example summoning a layer of arrows above the player. I don't know if this is ...
user avatar
1 vote
1 answer
85 views

On Minecraft Servers, are you able to see an item's player history?

For example are you able to see the history of every player that handled a specific item? Either through console or through a plugin? If so, do items that are convertible from ingot to block, such as ...
user avatar
3 votes
2 answers
400 views

How to detect if a player is within a mob's line of sight, and can that be changed?

Is it possible to detect if a player is within a mob's line of sight? And if so, can that line of sight be changed to only see things in 1 axis? For example, only being able to see things in front of ...
user avatar
  • 103
1 vote
0 answers
30 views

So I'm trying to have it when you click a sign it makes it seem like your game is being hacked plz help me I'm on bedrock edition [closed]

ONLY using signs thxs! and only on BEDROCK edition not java
user avatar
0 votes
1 answer
38 views

How to Group undead mobs in a datapack?

I have this in my datapack, in a JSON file: { "values": [ "minecraft:drowned", "minecraft:husk", "minecraft:phantom", "minecraft:skeleton&...
user avatar
0 votes
1 answer
58 views

Is it possible to make a villager you cannot interact?

I am trying to make something like the morph mod, where you can become a mob, but with a villager, when I want to right click, I interact with the villager. How to make it so that I cannot interact ...
user avatar
0 votes
1 answer
123 views

How to teleport a villager with a pseudo NBT tag?

Pseudo NBTs are like NBTs that aren't real like these: So I tried doing something like this: But it says this: I don't want mods - I want to do this in vanilla Minecraft.
user avatar
0 votes
0 answers
50 views

How to double melee attack damage within same tick as projectile strike

In many Java Edition servers, there are plugins in which you can deal double damage by hitting someone with a projectile such as a snowball or a fishing rod and then your sword within a given time ...
user avatar
  • 500
1 vote
1 answer
5k views

Disable PVP in Minecraft with a command

Is there any way to disable PVP in Minecraft Java edition with a command, if I already have teams created that are needed? Things I've Considered/Tried Creating a team named all, giving it to ...
user avatar
1 vote
1 answer
50 views

How to make mobs spawn where the player is at random intervals?

Hello I'm trying to make a plugin/mod where mobs(1 - 31) randomly spawn at the players coords, but I'm very new to coding in Minecraft so any help will be appreciated. I'm playing on 1.18
user avatar
0 votes
1 answer
284 views

How to create a dust particle that deals damage in Minecraft?

I'm in 1.16.5, I have tried for weeks and I just can't get it. The most progress I have ever got is this: /execute as @e[type=item,nbt={Item:{tag:{ThornPounce:1b}}}] as 1_1COOKIE1_1 at 1_1COOKIE1_1 as ...
user avatar
1 vote
1 answer
91 views

How do I create a sign which can be clicked with a specific item to run a command?

I want to place a sign on a block with the text '1' on its first line, that also, when you click on the sign whilst holding a piece of paper with the name '1853914142' it runs a command. This is what ...
user avatar
0 votes
0 answers
38 views

How to summon a ravager with momentum

I want to summon a ravager with a certain momentum on a command block? I did summon minecraft:ravager but I don't know how to give it momentum.
user avatar
  • 101
0 votes
0 answers
39 views

How to spawn an NPC that already has commands?

I've got an NPC egg, fully customized it with commands and text, but I want to have it at multiple spots in my world. Is it possible to copy it or put it in a spawn egg or any other form of similar ...
user avatar
0 votes
0 answers
40 views

How can I turn off a repeating command block if I don't know its coordinates? [duplicate]

I've placed a command block and it is spawning mobs. I don't know its coordinates and without that I can't turn it off. That world is a huge build and if I can't break the command block I will lose ...
user avatar
  • 1
0 votes
1 answer
73 views

How to make a clock in Minecraft?

I want to create a clock that tells the player the current game time out of the 20 minutes in a day. I couldn't figure out any commands that did this, so I made a Redstone clock that activates every ...
user avatar
0 votes
1 answer
99 views

Minecraft scoreboard operation by number

In Minecraft Java 1.18.1 I want to operate two scoreboard with a number like: scoreboard players operation @p lives = (@p deaths - 3) But this command is not working, can anyone help me please?
user avatar
  • 1
0 votes
1 answer
73 views

How do I give myself blocks that can only be placed on red wool? [duplicate]

All wool blocks use the minecraft:wool tag. Does anyone know how a solution? So far I only have this: /give @a minecraft:stained_hardened_clay 5 9 {CanPlaceOn:["minecraft:wool"]}
user avatar
  • 1
0 votes
1 answer
77 views

How to make arrows to not bounce back but explode when they hit an entity?

I made arrows explode when they have the {inGround:1b} tag but the problem is that they won't explode when they hit entities, instead they bounce off them and hit the ground then explode. How do I ...
user avatar
  • 1,032
0 votes
1 answer
80 views

Check for named item in helmet slot not working

I am trying to make a SCP-035 mask in Minecraft with command blocks. (since I think it would be fun and people only make NPCs) I am trying to make the part where it checks when you put it on and then ...
user avatar
  • 1
3 votes
0 answers
48 views

Who is the Command Initiator?

I have been playing Minecraft for years and have an ok understanding of the command system inhabiting it. What troubles me the most recently revolves around the command initiator. As we all know @s ...
user avatar
  • 1,032
2 votes
0 answers
47 views

Undroppable Quest Items for Minecraft 1.12.2?

I've been creating a modded adventure map over the last three years and have finally decided to deal with an issue that I've been aware of for a long while. I'm trying to make it so certain items are ...
user avatar
1 vote
1 answer
67 views

How do I make an operator with specific permissions?

In Minecraft I want to make my friends operators but I don't want them to be able to run all the commands a operator can run. For example, say I make my friend an operator and now they can use / ...
user avatar
  • 1,097
1 vote
1 answer
44 views

Struggling with CanPlaceOn tags in MCPE [duplicate]

I'm trying to spawn an item that can only be placed on specific blocks, and I know this can be achieved by using: /give @s (item) 1 0 {CanPlaceOn:["block"]} I've tried this several times, ...
user avatar
0 votes
3 answers
114 views

Prevent people from mining specific blocks

I'm making a prison, and I want to prevent people from mining specific blocks. How do I prevent players from destroying cracked stone bricks, signs, and red carpet blocks?
user avatar
2 votes
1 answer
171 views

How to stop people from sprint jumping?

As part of a datapack-powered PvP map we want to apply slowness to players. Sadly we have run into the issue where slowness does not affect sprint-jumping speed, meaning even players with slowness 100 ...
user avatar
  • 448
0 votes
1 answer
138 views

Minecraft Schedule Command not working

I have a datapack in which a gun can be reloaded automatically when mag is emptied. There is a reload.mcfunction that would set the ammo value of the current player to full. What I want to do is, when ...
user avatar
  • 1,032
0 votes
2 answers
66 views

Can run command for only one if score statement

I am trying to make a voting system for difficulties in my Minecraft world. I have set up the command blocks that add the score for a fake player named #VoterDirector for each difficulty. To test if ...
user avatar
1 vote
1 answer
606 views

Is there a way in 1.18 to limit/kill mobs in forceloaded chunks (with a goal to minimize active entities and server lag)?

BACKGROUND: I have a minecart rail line that services a few farms which are good distance from spawn (1400 blocks), picking things up and returning them to my storage (sorter). I've done /forceload ...
user avatar
0 votes
0 answers
113 views

Put players in spectator on death

I want to put players into spectator mode when they die, at the location they died at. My current attempt involves tracking player deaths using a scoreboard variable that increases on death. When said ...
user avatar
  • 448
2 votes
1 answer
122 views

How to move a large structure in Minecraft?

I tried to use the /structure save command but it did not work, because it stated that it was too big of a section to save. Is there any other command that I could use to do it all at once?
user avatar
1 vote
1 answer
103 views

Can I freeze a player in place?

Is there a way to freeze a player in place in bedrock edition? I have already tried /execute @p ~ ~ ~ tp @p ~ ~ ~ in a repeating command block, but it does not update fast enough.
user avatar
2 votes
1 answer
122 views

How to make armor stands follow you when in a specific vehicle in 1.17.1

I have tried to make an artillery cannon data pack. I want it so that when sitting in a minecart with tag "gun" multiple armor stands with blocks on their heads make the cannon body move ...
user avatar
2 votes
1 answer
478 views

How to change mobs' health with NBT?

I am aware this has been asked and answered before, but I can't find a solution that works for me, somehow. Aside from giving the mobs health_boost, that is. But that works per 4 health, so this isn't ...
user avatar
3 votes
1 answer
181 views

How to make mobs attack other players, but not me?

I am making a minigame where I will have a spider that doesn't attack me, but attacks the other players. I know that I can use teams to turn off friendly fire, but the problem is that everyone is ...
user avatar
  • 77
0 votes
2 answers
159 views

1.16.4 - /playsound for everyone, but at a specific player

This may seem complicated, but what I am trying to do is that when any player walk on water for a bit, a playsound will be executed at the position of the player that walked on water, but everyone ...
user avatar
  • 77
-1 votes
2 answers
197 views

CanDestroy tag doesn't work in 1.18

People say "can destroy" lets you break some things in adventure mode, but every time I try it, it does not work in 1.18. Is there a way to make it work? Here's my command: /give @p ...
user avatar
0 votes
1 answer
77 views

How do I randomize block position with /setblock in Minecraft Bedrock Edition?

I wanted to make an Among Us style map on Minecraft Bedrock Edition, (to play with friends) and I was trying to make the "Eject trash" task and want the dirt block that is placed outside of ...
user avatar
  • 1
1 vote
0 answers
85 views

Why isn't my /execute command working?

I put in this command through Bedrock: /execute @a ~ ~ ~ detect ~ ~-1 ~ sand 1 effect @p instant_damage 1 15 Although when I go to use it, it says: Syntax Error: Unexpected "remove": at &...
user avatar
2 votes
1 answer
55 views

Help with loading far away random chunks using commands

I'm making a working Tardis in Minecraft using datapack dimensions. Part of that is the ability to send the Tardis exterior anywhere in the world (And eventually in the Nether and End too). The /...
user avatar
  • 101
1 vote
1 answer
134 views

How to make specific mobs in Minecraft make no sound

In my regular Minecraft survival world (1.17.30), I want to know if there is a way to make only certain mobs make no sound or only some sounds. Example 1: A creeper would not hiss when charging but ...
user avatar
  • 1,097
2 votes
1 answer
107 views

Is there a way to make a variable in Minecraft?

Can you make variables in Minecraft Java? I want to make an armor stand tp to where I am looking, but I want to make the local Z coordinate editable with scoreboard. My command would be: /execute at [...
user avatar
  • 21
4 votes
0 answers
129 views

Is there a way to run a command when the player joins the SINGLEPLAYER world?

I'm wondering if there's a way to run a command when someone joins a Single player world, I'm a upcoming map maker and I making my first map, I have lots of experience with Redstone but never got this ...
user avatar
  • 41

1 2
3
4 5
97