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
18 views

I can't find a specific mob's health

I am trying to check a PVP bot's health, except every time I try to. it says it can't. Here is my current command: /execute if entity @e[name=Skeleton] [nbt={Health:10.0f}] run setblock 49 157 81 ...
3 votes
2 answers
46 views

What should I do with this /tp command?

I am trying to teleport a mob directly behind the selected player. I have tried using relative location of the player's head (^ ^ ^) but that caused the entity to suffocate underground when you look ...
2 votes
1 answer
30 views

How to place a red bed on a cyan carpet in Minecraft Java 1.19

I am using Minecraft Java 1.19, and I would like to place a cyan bed on a cyan carpet, but can’t figure out how to do it. Part of the problem is that when things are placed above carpets, they hang ...
1 vote
1 answer
34 views

How to make expanding worldborder every day?

I have a setup where a command block is attached to a daylight sensor. Every time it's night it expands the world border by 1. I want to make it so that each day increases more. For example, first day ...
-1 votes
0 answers
47 views

What's the command for playing ambient sounds (ex: cave noises)?

I’m confused because I’m trying to make a horror map, though I can’t seem to find any way to make cave noises through commands. Bedrock v1.19.22
1 vote
0 answers
25 views

Is there a command that fills blocks based on biome? Or a mod that visualizes the boundaries?

I am trying to visualize some biomes in my single player world. Once there were mods helping with this task, but none I can find works with 1.19 and above. Is there a command or a mod that helps ...
  • 1,949
0 votes
0 answers
14 views

How can I increase the damage a mob does in Minecraft Bedrock?

I'm making a backrooms map in bedrock and I'm using the silverfish as a hitbox for the entity. Although the silverfish moves fast, it doesn't deal enough damage to the player. How do I fix this?
0 votes
0 answers
15 views

How to detect right click whilst holding an item with an nbt item [duplicate]

I am making a sort economy system for my server and I use paper with the name "1 Paper Point" and the lore "Right Click to turn into Ranking POints". I was planning on making it so ...
-1 votes
0 answers
15 views

Home beach of command spawned turtles

I'm playing the OneBlock world of IJAMinecraft, and i've breed some turtles to make them lay eggs, but unfortunately, as they have been spawned from the OneBlock (so using commands), they won't lay ...
-1 votes
0 answers
24 views

Detecting Tags Then Preform a Command Based Off of the Number in Minecraft Bedrock

I am currently working on a Minecraft Among Us using command blocks. I need help figuring out how to count tags, which I have placed on people who die. I would like it to detect the number of people ...
  • 1
0 votes
2 answers
39 views

Using /execute to detect if player is located at entity

Before I say anything, I would like to say that I do not have much experience with commands. Is there a way to use /execute to detect if a player is located at an entity? I tried execute if entity @p ...
0 votes
0 answers
33 views

How to make a Command Block search and clear Item from player? [duplicate]

I'm trying to make sort of a command block trade shop thing. I've got it working with these commands in a chain of command blocks: execute as @a if data entity @s {Inventory:[{id:"minecraft:...
2 votes
0 answers
31 views

Using command blocks, how can I automatically place mined blocks into the inventory of the player who mined them?

Is it possible to make it so that each time you mine a block, you get the block, using command blocks in MCPE? It doesn't matter what tool you use, or just your fist, it just appears in your inventory....
1 vote
0 answers
28 views

How to make a weapon that executes commands

Is there any way to create a weapon the executes a command when you hit someone one with it. For instance, in my case, to make a ban or kick hammer type of weapon.
  • 143
0 votes
1 answer
60 views

Armor piece doesnt grant special effects when worn in Minecraft (command Blocks)

In minecraft 1.19.2, I used this command to give myself the iron boots: /give @p iron_boots{Unbreakable:1,Tags:[Special],display:{Name:'[{"text":"Heavy Boots","italic":...
2 votes
1 answer
47 views

How do I copy a player's coordinates into a Lodestone?

I'm trying to make a manhunt compass using lodestone NBT, avoiding /setworldspawn issues, but I'm having trouble copying the runner’s position array data to the compass' LodestonePos NBT tag, ...
1 vote
0 answers
43 views

Why are my players respawning at the world spawn rather than their beds?

I set the home, and set the bed to wake up. But when I die, I start automatically on the world spawn area. Can you tell me how to set that all players in the server when they die, revive on their bed ...
  • 11
3 votes
3 answers
58 views

Can I run several commands after /execute, instead of just one?

I want to create a Minecraft datapack in which I can shoot an arrow and, when it reaches its target, summons a lightning bolt. Currently, I have this: execute at @e[type=Arrow] unless block ~ ~-1 ~ ...
  • 33
4 votes
2 answers
593 views

How can I specify a count that's greater than or equal to a given number in a command? [duplicate]

I was looking to know if a player (in Minecraft v. 1.16.5) had enough items to execute an action so I wrote the following command: /execute at @a[nbt={Inventory:[{id: "minecraft:gold_ingot",...
  • 41
3 votes
2 answers
153 views

Is there a way to track which buttons were pressed when using command blocks?

I'm making a map (in Minecraft 1.19.2) where players open doors on a square map made out of rooms. Most rooms have 4 doors, which the player should be able to open from both sides. I wanted to make ...
0 votes
0 answers
34 views

How do I give myself a map with a specific map number? [duplicate]

I want to use commands to give myself a map that correlates to like map_1.dat in the data folder, I've tried /give @p minecraft:filled_map 1 0 and other things, but they don't seem to work in ...
-1 votes
1 answer
37 views

How do I limit my raycast range?

I have these raycast commands and I want to put a range of 6 blocks on it. How can I do it? execute as @e[dx=0, distance=0.1..] positioned ~-0.99 ~-0.99 ~-0.99 if entity @s[dx=0] run effect give @s ...
  • 89
1 vote
1 answer
48 views

How do I exclude only myself in an execute command?

I have followed a raycasting tutorial: . I stopped at 7: 17 because I don't need headshot detection. It says to exclude players to avoid putting the effect on yourself. ...
  • 89
0 votes
1 answer
43 views

How to teleport entities named with a space? [duplicate]

I can't teleport entities with names like 'big boy', "reverse flash", since in the /tp command both "big boy" or "big_boy" are not working. /tp @e[type=horse,name=CROSS ...
1 vote
1 answer
61 views

What is the 1.12 equivalent of /execute if score?

In Minecraft, I want a command to execute when a score is changed. For example, I have a scoreholder named cameraactive on an objective named Debug. I want a command to run when this score becomes 1. ...
0 votes
0 answers
39 views

Command Block Not Working After Increasing Distance

gamemode 0 @p[rm=9,r=10,m=!0] works fine. However when I try to do: gamemode 0 @p[rm=99,r=100,m=!0] It doesn't work. It just keeps saying "No Targets Matched Selector".
2 votes
1 answer
95 views

How to teleport a specific NPC to the player (Custom NPCs Mod)

I'm using the Custom NPCs mod in MC 1.12.2 and I have the command to teleport the NPCs to the player /tp @e[type=customnpcs:customnpc] ChaoticDuskMC However, I want to teleport a specific NPC that I ...
-1 votes
1 answer
43 views

How to determine if several players are standing in a certain zone

I'm making my map in Minecraft and making it for several players, I want to make sure that all the players on the map could execute a command in a certain place, that is, all the players who are ...
0 votes
1 answer
40 views

I don't know why the playsound command doesn't play when the player gets teleported

I was triying to make a teleporter when a player steps on a obsidian block, but the sound wont play. Here's the command blocks if that's any help. Repeat, always active: Execute as @a at @s if block ~ ...
1 vote
1 answer
51 views

Need help slowing down arrows minecraft 1.19

I'm trying to slow down skeleton arrows in minecraft 1.19, but I can't find any command to do it. I tried giving them slowness but they can't have effects. Is there something in the nbt I can change?
  • 17
2 votes
1 answer
52 views

How to convert milliseconds to seconds with separator?

I am building a practice bridging map for me, and need to convert milliseconds to seconds, but with a separator. Example: Milliseconds Result 50 0.050 150 0.150 4900 4.900 28769500 28769.500 The ...
-1 votes
1 answer
75 views

Minecraft - /give command not working with multiple enchantments

Using this command works fine: /give @p minecraft:diamond_sword{Enchantments:[{id:sharpness,lvl:2000}]} Using any of these doesn't work: /give @p minecraft:diamond_sword{Enchantments:[{id:sharpness,...
  • 1
0 votes
1 answer
84 views

How to force load chunks using commands?

I have a Minecraft Bedrock Realm and I use command blocks all the time for magic weapons and other things. My only issue is they don't stay loaded, therefore the command blocks are not active. I was ...
0 votes
0 answers
32 views

How to detect if an item is in someone's hand? [duplicate]

I was wondering if there was a way to detect if a player has an item in their hand in Minecraft Bedrock. Previously, I used the /enchant command but it was sloppy and it just enchanted every book they ...
0 votes
1 answer
34 views

How to gradually increase teleport amount

I'm trying to make an armor stand accelerate towards the ground, but the method I am using to move it is teleporting it forward, so it won't go down in the process. I can't find any way to use a ...
0 votes
0 answers
115 views

How to make hostile mobs passive using commands?

I have a Minecraft Bedrock Realm and one of my friends wants to have a mob army. So with commands I worked out how to summon mobs and how to equip armor and tools but my main issue is how to make them ...
0 votes
0 answers
21 views

How do I make a neutral mob?

I'm making an addon using crafty craft for mcpe and I can’t seem to figure out how to make neutral mobs (i.e. Mobs that are passive until attacked by a player) I’m using custom functions for one of my ...
  • 1
0 votes
0 answers
14 views

How can I summon falling block on Switch? [duplicate]

I've tried summoning it but it won't work. I'm on Switch too, so I guess that's why.
0 votes
0 answers
29 views

How to find lost command block using mac compatible tools without NBTExplorer? [duplicate]

I'm trying to find a command block in my world but I don't know where it is, and I can't use NBTExplorer because that's incompatible with my computer. Anyone knows how to solve this?
0 votes
0 answers
14 views

I want to make a security system for my Bedrock Realm [duplicate]

I’ve tried /kill @e[r=10] so it kills all entities including me. How can I make it so it kill all entities and players except myself? Ive tried /kill @e[r=10][type=!(username)] but it just throws an ...
0 votes
2 answers
45 views

How can I target an entity that has a period in its type ID? (1.8 minecraft)

I'm currently making an adventure map with custom mods. My modded mobs have id's like "zssaddon.landOctorok" instead of simply "Zombie". Because of this, commands like /kill @e[...
1 vote
0 answers
51 views

How do I detect what sword attack is being performed?

I am making an adventure map and I want a section where you practice combat. This section needs to go through doing a critical attack, a sweep attack, and a normal attack. I was wondering if I'm able ...
  • 11
1 vote
1 answer
42 views

How to detect a player's height when floating?

I want to make a command that, when used, detects how high above the ground I'm floating and then teleports me to the ground. But I'm not sure how to detect how high the player is above ground.
  • 11
5 votes
1 answer
71 views

What command can I use to generate a Lingering Potion item with specific radius?

Normally with /summon command I can generate a Lingering Potion Cloud Effect that does what I want: /summon minecraft:area_effect_cloud ~ ~ ~ {Radius:5,Duration:10000,Effects:[{Id:5,Amplifier:0,...
0 votes
2 answers
86 views

How do I give a Netherite Sword strength 2 if it's named a specific way?

Here's the command I've tried: /execute at @p[nbt={SelectedItem:{id:"minecraft:netherite_sword"}}] run effect give @p minecraft:strength 1 2 This works on all netherite swords. How do I get ...
1 vote
2 answers
103 views

How do I delete dropped items that contain a specific tag [duplicate]

Video of what is happening I'm working on a medkit in Minecraft and I want it to work when I drop it. I need help on detecting dropped items with a specific tag. The base of the medkit is going to be ...
-1 votes
1 answer
128 views

How do I make a playsound command follow the player?

I'm in Minecraft 1.12.2 (because of mods I use), and would like to have game music in the background. So, I want the sound made by a playsound command to follow the player. I use this command: /tp @e[...
0 votes
1 answer
113 views

Detect when players cross Z coordinate 1.19

I've seen similar questions, but their commands seem to be outdated. Although I don't have much experience with location-based command blocks, so forgive me if I am wrong. I am trying to execute a ...
  • 243
0 votes
0 answers
47 views

Command Block Clearing

Whenever I place a command block and fill it with information, it clears with a block update. Also it doesn't show changes to other players. Notes: Realm; Version 1.19.10; Bedrock Edition; Not owner ...
-1 votes
1 answer
27 views

Problem with detecting tags on armor in 1.19

I put the command effect give @a[nbt={Inventory:[{Slot:100b,id:netherite_boots,tag:{Tag:["Custom:26"]}}]}] minecraft:fire_resistance 1 1 true in a always active repeat command block, as well ...

1
2 3 4 5
99