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
-4
votes
2answers
35k views

How do I spawn fused TNT at a players location through the console?

Wanna troll a friend on minecraft I couldn't find anything on the internet so I went here
0
votes
0answers
6 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 ...
0
votes
0answers
24 views

Specific command to reset a player's health back to a certain amount by hitting someone with an item

Me and my friends are trying to code tennis in Minecraft, and one of the functions is a constant wither effect on the ball, which is a player, to act as some sort of "timer." Is it possible ...
4
votes
1answer
6k 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
0answers
15 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 &...
1
vote
1answer
275 views

How to detect if somebody is holding something while activating a noteblock

So I'm building a map with right-click detection via a noteblock and I have this command: /execute if block 21 107 38 minecraft:note_block[note=1] if entity @p[x=21,y=107,z=38,nbt={SelectedItem:[{id:&...
0
votes
1answer
32 views

how to make a named trident execute a command

So i'm making this world with lots of commands and when a trident hits the ground, it makes a cow named bob spawn. and when an arrow hits the ground, it gives a diamond. two is not enough for my next ...
1
vote
1answer
85 views

Add armor attributes with /item modify- 1.17 datapack issue

I am trying to modify the armor a certain entity is wearing (based on material) by adding a very slight movement speed decrease, which I should be able to do with attributes. I have the entity tagged ...
2
votes
0answers
21 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 /...
2
votes
2answers
49 views

How do I give particle effects to my dog in Minecraft?

I am in a normal survival world and I have a dog named Charles (name tag). I want to give him particle effects when he walks, attacks, and gets fed. I know you can give arrows and players effects but ...
1
vote
1answer
81 views

How do I detect when a block is broken?

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?
0
votes
1answer
83 views

Minecraft, Dead By Daylight minigame question

I have a question about a game I am creating. In the game people have to make 5 devices activate and how I plan to do this is they have to click a button 100 times with the command, /scoreboard ...
2
votes
1answer
42 views

How to hide an unbreakable tag in an unbreakble item?

I know how to make an unbreakable item, but is there a way to make it so that nobody can know that it's unbreakable?
1
vote
1answer
41 views

Syntax error: Unexpected "score: at "execute if >>score<< Seconds Timer matches 60

I am trying to make a digital clock using the scoreboard commands and command blocks, when I try doing this and have followed steps correctly it says Syntax error: Unexpected "score: at "...
1
vote
1answer
20 views

Is it possible to use scoreboards from NBT number values?

I have this NBT tag on a slimeball: {price:200}. How would I use /scoreboard players remove or something similar to that to remove coins from a player off of this value price? So in this case it would ...
0
votes
1answer
310 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 ...
2
votes
0answers
33 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 make a hiss sound when ...
0
votes
2answers
57 views

How can I create a command that gives me an effect every time I take damage?

I want to make a command that makes it so that every time I take damage, I get regeneration 3 until I come back to full health. I have zero knowledge of commands and coding so I'd appreciate some help....
0
votes
1answer
29 views

How do I make it so when an item with a tag is thrown on the ground, mobs close to it (1 block) burn?

I'm making some items to use for setting mobs on fire, cuz one of my custom mobs is weak to fire and this is one I came up with but I'm having some trouble (mostly with the fire part). So, how do I ...
1
vote
1answer
91 views

Reapply Bad Omen if a player drinks milk until player triggers a raid?

I can't seem to figure out how to test if the player has started a raid with commands. I'm trying to make it so the bad omen status effect is not removed by milk as any other potion effect would be. ...
4
votes
1answer
47 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 ...
2
votes
1answer
35 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 [...
2
votes
1answer
22 views

I can't get the summon command to work in Minecraft

I am currently making a boss fight for some of my friends and I can't get the summon command to work and give then entity the right amount of health, even though I use the correct attribute names and ...
4
votes
1answer
125 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 ...
20
votes
6answers
15k views

How do I kill mobs using /kill without them dropping loot?

I have a spawn area I am hoping to make a safe haven, so I have a command block on a clock that kills each hostile mob type. This works to keep the place free of any hostile mobs, however every night ...
6
votes
1answer
743 views

Summoning enderpearls on arrows with custom name shot by a player

I want to shoot an arrow named "GreenArrow" that constantly summons enderpearls named "GreenPearl". Those pearls should execute a command at armorstands within 1 block. That command is /setblock ~ ~-...
2
votes
1answer
19 views

Error: Objectives cannot be longer than 16 characters

I make use of scoreboards to keep track of variables. However, this error popped up on the console when I tried reloading my datapack: Failed to load function terraria:wands/rod_of_discord/use java....
2
votes
1answer
363 views

ArmorDropChances Data Tag below 0.1?

Im messing around with armor drop chances for a map im creating and I have yet to find out any information on the web explaining this: Does the minecraft binary recognize a value for armordropchances ...
1
vote
0answers
19 views

How to make a Countdown Function in Minecraft [duplicate]

I'm new in the whole Minecraft Function stuff but I want to create a Function that should do something after a 3 second Countdown which appears as a title. I tried it with the /schedule command but it ...
1
vote
1answer
812 views

Clone command help wanted

I have created a Mech that I intend to make move using the clone command. I want to clone the position of the mech then make it appear a couple blocks in front of it. So far I can clone the mech but ...
3
votes
1answer
465 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 @...
1
vote
1answer
157 views

In minecraft, How do i set a spawnpoint using command blocks

I'm trying to make a parkour course and I want to have the player respawn at every new checkpoint they reach when they die
1
vote
0answers
24 views

How does the /tellraw command work?

I tried this: /tellraw @a {"text":"","color":"blue","extra":[{"selector":@p[score_wins_min=1},{"text":" has won the game!&...
5
votes
1answer
63 views

In Minecraft how do I stop my dog from dying to other people

In my Minecraft survival server I have a dog named Charles (with a name tag) and I love him very much, but the people on my server are very destructive and I am afraid that when I leave they will kill ...
5
votes
2answers
72 views

How to stop all players from dropping any items?

We are creating a kit-based PvP map for Christmas. Players will be able to select a kit to fight with. Using /gamerule keepInventory false we can prevent players from dropping items on their death, ...
3
votes
1answer
674 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 ...
0
votes
1answer
19 views

Is it possible to change a villagers profession using /event?

Im making a world that depends on certain villager professions to make it work best. Can you use the /event command to change a villagers profession?
0
votes
1answer
26 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
1answer
203 views

How to host multiple Minecraft servers on the same IP?

I just started a Minecraft server for me and one of my friend groups to use, but I'd also like a separate server for my other friends. I downloaded the server file again, made a new folder, did all ...
0
votes
1answer
13 views

How do I use replace item in Minecraft Bedrock with enchantments?

I've been trying to learn commands and it's been a struggle so I'm looking for help trying to find out how to use the replace item command with enchanted items
17
votes
1answer
2k views

Where can I quickly get a list of all Minecraft blocks?

The title may be a bit unclear so let me explain a bit better; I want a list of every block currently in game for a datapack I'm working on. To be clear which way I want them: acacia_button ...
1
vote
2answers
70 views

How to apply potion effects only in a certain radius, without applying it to yourself?

I'm trying to apply potion effects to mobs in a certain radius of me without applying it to myself as well, is this possible to do with the current state of commands in Minecraft 1.17?
4
votes
0answers
90 views

Is it possible to stop myself from breaking bedrock in creative?

I am trying to plan a farm near bedrock in the overworld. I created a copy of the word location and I would like to plan the farm in creative, then build it in survival with the help of litematica. ...
29
votes
5answers
239k views

Is it possible in Minecraft to switch over from survival to creative in single player?

This question is regarding the minecraft Beta 1.8 prerelease -- I have a beautiful house in single player survival which I'd like to record while flying. I want to be able to change the game mode of ...
2
votes
2answers
1k views

Is there a way to show all the kills of a team in one scoreboard?

I'm having trouble making a scoreboard that shows all of the collective kills from every person on the team, not just the individual players, is there an easy way of doing this? And to be specific, I'...
3
votes
1answer
151 views

Minecraft Windows 10: Is there a way to enchant armor a player is wearing?

I'm setting up a killer gamemode and I would like the killer to have armor with the curse of binding on it. I'm triggering the transformation with a single button attached to multiple command blocks. ...
3
votes
1answer
100 views

How can I place a block randomly around my world?

I downloaded a lucky block mod and I want to place them randomly in my world. Is there a command to do this? I'd prefer the entire world to be affected but if it's just around 200 blocks then that's ...
0
votes
1answer
39 views

How do you use the player-sensing command in Minecraft Bedrock?

I am trying to make a door that will disappear using the /fill command and make it so that if certain players stand in front of it it will open. How can I do this?
0
votes
1answer
32 views

Select the current entity with a command block

In Minecraft java edition, @s stands for "current entity" and works only if you type in chat. Is there any other way to use the current entity on command block? @s doesn't work there.
7
votes
1answer
114 views

Check players permission-level

I am currently working on a minecraft map for realms, and was wondering if there is any way to check a players op/permission level. In a minigame, no one has operator permissions except the owner who ...

1
2 3 4 5
93