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
1 vote
2 answers
94 views

How do make water poisonous, but also resistible?

I was wondering how to make all water completely poisonous in Minecraft 1.18.1; as in, give you wither. My current command (gotten from Google) is: /execute @a ~ ~ ~ detect ~ ~-1 ~ Minecraft:water 0 ...
0 votes
1 answer
55 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 ...
2 votes
1 answer
747 views

How do I pre-generate a Minecraft bedrock world

I am looking for a easy script that can teleport me across my Minecraft Bedrock Edition world so I can generate the chunks without causing lag as people explore my server. Please make sure it works ...
2 votes
2 answers
193 views
+100

Proper path to modify villager anger?

I would like to make villagers angry on command. I assume I need to use /data modify, but I do not know the proper <targetPath>. I have the following so far: execute as @e[type=villager] run ...
6 votes
1 answer
11k views

How do I use an NBT editor to modify item properties?

In Minecraft, the NBT (Named Binary Tag) format is used to store data of our Minecraft worlds, including block, entity, and item properties. In the Java Edition of Minecraft, you can modify this data ...
5 votes
1 answer
49 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
1 answer
22 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[...
0 votes
0 answers
31 views

Check whenever a player has died

I have a scoreboard named "3ldeath" that updates whenever there is a death. I want to check whenever a player has died. If he died once, he goes in team Green. If he died twice, he goes in ...
4 votes
1 answer
8k views

Summoning an arrow aimed at a mob

I want to summon an arrow that is fired in the same direction as the player that it is summoned closest to, is this possible with just commands and as minimal command blocks as possible? (not one ...
1 vote
1 answer
34 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.
1 vote
0 answers
31 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 ...
0 votes
2 answers
1k views

Can't summon mossy stone bricks

I'm using Minecraft 1.11 and am having trouble summoning a mossy stone brick. I am using /setblock and can summon a normal stone block, but not mossy. I have tried mossy_stoneblock, stoneblock:1, ...
1 vote
1 answer
348 views

How do I detect when a block is broken? [closed]

I am trying to create a command block creation. However, I want to detect when a certain block in my world is broken, without using observers, only command blocks. How do I do this?
-1 votes
0 answers
21 views

Tag command doesn't work

I tried entering this command in Minecraft Bedrock 1.19: tag @a[add scores = {K = 50..}] EE It's supposed to make anybody with the score of "K" over 50 get the tag "EE" ...
0 votes
1 answer
317 views

Chain Command Blocks Not Equipping Armor?

The following command is used to force the player to equip armor: /replaceitem entity @p[type=Player] slot.armor.head chainmail_helmet 1 0 {display:{Name:"Archer Helmet",Lore:["You feel somewhat ...
6 votes
2 answers
2k views

How can I detect if a person takes fall damage?

I am trying to make a command block creation that when you take fall damage, it gives you an effect. I am not using any of the methods that detect for air -1 meter of the player ( 1 , 2 ) because ...
1 vote
1 answer
205 views

/execute working in command line but not in command block

I'm new to commands, so it's very likely that I'm missing something obvious. I'm trying to teleport myself from the Overworld to specific coordinates in the Nether. The command works in the command ...
3 votes
1 answer
165 views

Summoning a falling entity on top of an arrow which had just hit the ground

This is just a follow-up question from my previous one, Specific lightning arrow task, after the arrow strikes, and only using a specific bow. So in that one, I asked how would one summon lightning an ...
2 votes
1 answer
509 views

ArmorDropChances Data Tag below 0.1?

Does the Minecraft binary recognize a value for ArmorDropChances below 0.1f? I have enemies that are dropping armour and it is dropping way too often considering the drop chances are 0.001f (I know ...
3 votes
1 answer
561 views

How to activate commands around a tagged entity with command blocks?

So I am trying to set the score of a person within two blocks of a tagged armor stand, but the commands I thought would work don't. I have tried execute at @e[tag=GFlag] run scoreboard players add @...
3 votes
1 answer
714 views

Creating a minecart spawner that had blocks riding them

I know how in 1.7 you can summon a minecart that has a block "riding" it, as in you can change the block's height above it, what block it is, etc. I also know how to make a minecart spawner. How can ...
-1 votes
0 answers
39 views

How do I change a block with a selected item in minecraft? [closed]

I need the command to replace a block with a selected item. I tried in a command block execute @p[distance=..10,nbt={SelectedItem"minecraft:blue_dye"} and it didn't work.
3 votes
2 answers
237 views

Is there a way to make a dispenser shoot out a fireball with a specific explosion power?

How do I summon a fireball with a specific explosion power in a dispenser? /summon minecraft:fireball ~ ~ ~ {ExplosionPower:200} I know how to summon one with commands, but I don't know how to make ...
0 votes
1 answer
95 views

Is it possible to use /replace and give it a enchant without affecting the rest of the armor?

I'm trying to make it so that the command block gives you an elytra and you can't take it off since if you do so it will duplicate, is there a way to give the elytra an enchant of curse of binding and ...
0 votes
2 answers
574 views

Tp command block proximity

I'm trying to make a portal hub to head N,S,E,W directions and a portal back again from each point back to world spawn near the hub. My first portal keeps teleporting and I cant get near it without ...
0 votes
2 answers
70 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
80 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
50 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[...
-1 votes
0 answers
44 views

How do I make a game restart when all players on a team are dead?

I'm working on a red vs blue type team deathmatch game, and after all players on a team are dead, I want everyone to be sent to the lobby. How would I do this? I'm on Minecraft 1.17.1
5 votes
1 answer
16k views

Minecraft webpage links in chat?

I have seen links in servers that can send you to a page in a browser, is there any way to replicate this with command blocks? I don't mean command links, I mean web pages.
3 votes
1 answer
192 views

How can I keep mobs from being too close together with /spreadplayers and /execute?

I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other ...
1 vote
1 answer
971 views

How to program a command block to teleport if there is exactly one player nearby?

How can I program a command block (or a combination of blocks) to teleport nearby player only if there is exactly one player nearby? I.e. when button pressed, if there are more than one player within ...
-4 votes
3 answers
6k views

How can you make a infinity damage sword?

I found this command : /give @p netherite_sword{Unbreakable:1b,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:2147483647,Operation:0,...
0 votes
5 answers
8k views

Empty syntax error on /give command

I type in /give minecraft:locater_map, or some other /give command, and it says Syntax error. Unexpected "" I keep thinking to myself: there is nothing in the quotation marks, so why do I get ...
2 votes
2 answers
385 views

Why am I getting an 'unexpected token' error with this Minecraft /give command?

I'm trying to make a sign that you can right click and it will clear cacti from your inventory, then give you 18 cookies named "$100 Cookie" with the lore "$100". But when I put it ...
2 votes
1 answer
2k views

Syntax error unexpected?

Can someone tell me what I’m doing wrong? Did I type this wrong? This is the command that I try to execute: /testfor @a[score_keycard_min=1,r=3] This is the error that I get: Syntax error: ...
0 votes
0 answers
26 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
0 answers
40 views

How can I detect if an arrow has hit an entity? [duplicate]

How can I detect if a player's arrow has hit an entity in a command block?
-1 votes
1 answer
24 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 ...
0 votes
1 answer
58 views

check for 3 or more blocks in inventory

I need to check for three or more cobblestone in a player's inventory using command blocks, I know how to check for the exact amount but not or more. let's say the player has 3 cobblestone in their ...
0 votes
2 answers
573 views

How do I create clickable text that executes a command?

I want a line of text to appear in the chat, that when clicked on will execute a /fill command. I have used the following command to no avail: (~ = desired message or command) /tellraw @a {"text&...
1 vote
1 answer
18 views

Detect block below a player in a vehicle

I'm having trouble detecting a block below the player when the player is riding a vehicle. execute at @a if block ~ ~ ~ minecraft:rail run tellraw @s "Teste" This command works only if the ...
2 votes
1 answer
585 views

How do I use /testfor on a scoreboard on Bedrock Edition?

On Bedrock Edition, I'm trying to make a game and I only need to put in a system to see if a team has 10 points so they can win the game. I also don't know how to get an output from the command block. ...
0 votes
1 answer
115 views

Teleport players using rectangular radius

How would you teleport players using a rectangle radius? When I use the radius command, it selects a grid that's a perfect cube like (@e[x=1,y=2,z=3,r=6]) witch will select a 6x6x6 grid around the ...
-6 votes
2 answers
82 views

minecraft Command Block kill

Im the admin on a server and want to make a command block that turns it to day, but also have it that if anyone else right clicks on it, it kills them?
0 votes
0 answers
48 views

How do I use /give to give named items? [duplicate]

I have tried to find ways to get a named item with give but I can't find a way to get the item. Every time it says Missing ')' and I looked through forums and searched every command and I can't find ...
2 votes
1 answer
2k views

Player heads linked to player skin id

I know it is possible to give a player head with say ID of whatever skin you want but, I want to make it give the player head with the precise skin at the time the player is killed. I just don't want ...
0 votes
2 answers
38 views

Give a predetermined number as the amount of experience

I'm creating a datapack to give players experience for doing all kinds of stuff. As I am expanding, I've come to a point where it would be easier to keep track of the scores by having all the ...
0 votes
1 answer
31 views

How to make an entity teleport you to another?

I'm trying to do my own portal gun with only command blocks, and it is going pretty well. But, the thing is, I can't make the teleport system work correctly. What I'm trying to do is if you're in a ...
2 votes
1 answer
70 views

How do I make a painting invincible?

How do I make a painting unable to be broken? I am open to commands, addons, or even external programs if needed. The only way I have found is using weakness on players however I need them to be able ...

1
2 3 4 5
98