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
2
votes
1answer
82 views

Why do the less than(<) and more than(>) symbols don't work?

Im trying to make an minecraft map and i really need to check for an scoreboard, like, if your score is below a certain amount, it runs a certain command, but the less than(<) symbol doesn't seem ...
0
votes
1answer
30 views

Minecraft zombie visible range (bedrock)

Im working on a Minecraft map similar to a 3d Mario game. I am currently struggling on enemy AI and would like some help. I want to make it so when you are within the 16 blocks of a zombie, they act ...
-1
votes
1answer
31 views

How to make a modified mob spawn randomly on the map?

I'm doing a RPG in minecraft with some friends but we don't know how to make a modified mob spawn randomly on the map. We have a mob, and we have set it’s name, attributes, and other data. But we don’...
5
votes
2answers
1k views

How to destroy a block and give you an item in your inventory at the same time?

So me and my friend are creating a Mario-like game in Minecraft Bedrock Edition. We are struggling with trying to come up with code. What we need is so if the player is standing on a red mushroom it ...
1
vote
1answer
70 views

Removing a specific trade from a villager (minecraft 1.16)

I'm trying to make it so that when a villager runs out of stock of a specific trade, it removes that trade from the villager. I'm stuck at the part where I remove the trade. So far I can only wipe the ...
4
votes
1answer
194 views

How to change an item's attack damage?

I'm doing a RPG in minecraft with some friends but we don't know how to modify the sword damage with commands, we have already tried this command... /give @p minecraft:diamond_sword{AttributeModifiers:...
0
votes
2answers
63 views

I lost my dog on Minecraft, How can I get him back? [duplicate]

As I mentioned above my wolf Buddy Jr Jr (yes I know his name should be Buddy the third) is lost and I really want him back, if anybody knows what to do please let me know it would be very appreciated!...
2
votes
1answer
118 views

How to stop Items from despawning?

I searched up how to do this several times and I could only find ways to spawn items that cannot be picked up, and if it was a tutorial about stopping item despawning, it would still despawn after ...
2
votes
0answers
41 views

How can I specify only NBT in the /clear command, not an item?

A unique quirk about the /clear command is that it can clear items from the player's cursor, i.e. the one that is picked up and moving from slot to slot. Using this and conditional command blocks, I ...
1
vote
1answer
51 views

Is it possible to obtain high-level enchantments in MCBE? [duplicate]

I am playing on a Creative world in MCBE, and mess around with everything. I got the idea to obtain a Looting 32 sword using commands, but it errors out and says that the max level is 3. I tried using ...
1
vote
1answer
60 views

How to detect the death of a mob (minecraft 1.16)?

I am making a custom adventure map and there is an evoker bossfight (named "lunatic cultist"). I wanted to check when it died, but none of the tutorials I found actually worked (probably ...
0
votes
1answer
32 views

How do I place specific blocks on another specific block in 1.12?

I want to make a parkour map so when you finish a level it gives you a stone button that can be placed on a block. I've tried to use the following command: /give @p minecraft:stone_button {CanPlaceOn:[...
0
votes
2answers
94 views

What is the server command to give my named wolf more health in Minecraft version 1.16

What would the Minecraft Server/cheat command be to give a wolf more health. I know that you can make a named wolf invincible, but I'd prefer to just increase the wolf's health.
-1
votes
1answer
26 views

Is there a way to use relative commands in NBT tags?

I know you can use ~ to tell your current location, but when i do this: /summon minecraft:cow ~ ~2 ~ {Leash:{X:36,Y:82,Z:-434},NoAI:1,Age:-25000,Silent:1} and i replace the X,Y,Z with relative ...
2
votes
1answer
73 views

Is there a way to be the 'creator' of an iron golem when you summon it with a command?

When you create an iron golem manually (4 iron blocks with a pumpkin on top), it automatically labels you as its creator, and will not attack when you hit it. However, using the /summon iron_golem ...
-2
votes
2answers
345 views

How do i make a command block delay in minecraft 1.16 [duplicate]

I have tried multiple things that were used in earlier versions but they no longer work as commands have changed a lot so I was wondering how I can delay them for my adventure map
1
vote
1answer
72 views

Execute as selector if nearest entity has a tag

I want to execute a command to an armor stand if the nearest pig has a specific tag. The commands that I have tried so far... execute as @e[type=armor_stand] at @s if entity @e[type=pig,limit=1,sort=...
1
vote
1answer
86 views

Why does my third command block still run even though a command before failed?

I am on Windows 10 1.16.1 Minecraft I have a line of three command blocks: An unconditional impulse that needs redstone, A conditional chain that is always active, An unconditional chain that is ...
1
vote
0answers
86 views

Allowing functions to go through in a world with no cheats [duplicate]

So, I'm currently having a problem with a datapack I'm making, in a part of it, there's a tellraw that will summon an item at the player's position, and take points from a scoreboard, basically a shop....
0
votes
0answers
20 views

How do you change your Minecraft username on my Server [duplicate]

I have my own Minecraft server and I am an OP. My question is simple, how do I change my username/chat messages to say something like <[ADMIN] CarterCoding> Hello!
-2
votes
2answers
85 views

Can someone tell me what im doing wrong in minecraft command [duplicate]

What does it mean when it says line 1, Column 2 missing) or object member name
0
votes
1answer
81 views

Place a lever on only emerald blocks [duplicate]

I've done this before, but I have forgotten how to do it. I tried every command but nothing is working, and I was trying to be quick. Is there a way to do this in Minecraft 1.16?
0
votes
0answers
57 views

Checking a chest for a specific item

I've been watching video tutorials for using command blocks and browsed a bit on here before forming this question. I've been trying to make a shop where a player puts a few emeralds, let's say 8, in ...
1
vote
2answers
144 views

Referencing JSON file in Minecraft Bedrock via command [duplicate]

On Minecraft Bedrock Edition, I have just created a JSON file that creates a chest with random loot in it. The problem is that I don't know the command to get the chest that contains random loot. Here ...
1
vote
2answers
77 views

Can you teleport a player to a certain block without specifying the coordinates?

I'm trying to make it easier to move around my world but since I'm on my iPad typing is very bad. I want to type something short in my chat and then be teleported to a block I placed earlier of which ...
0
votes
2answers
41 views

How do I send data from one command block to another

I am trying to use /testforblock around a player so that whatever block it detects will be put in a certain slot in a certain chest with the use of /replaceitem. How do I send the block data from /...
1
vote
1answer
62 views

Need help in command to remove item from inventory

I have a small server with my friends, and we want to remove mending from play. I was thinking it will be easy now to just place a command block which looks on players inventory and removes ...
2
votes
0answers
31 views

How can I join multiple teams with different rules?

I want an Iron Golem, Zombie A, and Zombie B to be on a same team so they wouldn't attack each other but I want Zombie B to have a no collision rule. If I let Zombie B join another team with a ...
3
votes
1answer
51 views

How can I increase the knockback of a slime in minecraft?

I'm using command blocks to make a custom slime, I've tried using the command: /summon slime ~ ~ ~ {Size:3b,Attributes:[{Name:"generic.attack_knockback", Base:8.0,}]} but it doesn't work. ...
0
votes
1answer
97 views

How do I summon an item that has an owner and a pickup delay of -1?

I am trying to make an item that has no pickup delay, and also a different item that has an owner. The commands I have tried are: /summon item ~ ~-1 ~ {Item:{id:"minecraft:stone",Count:1b},...
0
votes
3answers
91 views

Is there a way to effectively prevent phantoms from spawning (1.14)?

The title may be vague (but I did that purposely to not make the question too confusing), but I'll explain more specifics/details here. First of all, I am looking for a method to not just get rid of ...
0
votes
2answers
65 views

Is it possible to make a “hot bar timer”?

Is it possible to make a hot bar timer while only using minimal resources and command blocks? If so, how would you do it? My aim here is for a compact, and precise timer above your hot bar that you ...
-1
votes
2answers
98 views

Can you tp entities to other entities in java 1.16.1

im trying to create a trident that when thrown will make salmon tp to it. the example command is tp @e[type=husk] @e[type=snowball] this was the test but it didnt work with (@e[type=snowball]) being ...
-1
votes
1answer
84 views

How do I tell what dimension a player is in? [duplicate]

How do I test for a player being in a world? I have 2 command blocks: the second one is conditional and relies on the first one to be correct for it to work. In the first command, I have this: /...
1
vote
1answer
46 views

How do I test for player 1/player 2/player3/ etc in a scoreboard?

In Minecraft, when displaying a scoreboard as "list" it will show [1] to the left of the person who is on the top of the list. I would like to know how I can test for who has the [1] and [2] ...
1
vote
1answer
82 views

How do I correlate the pitch value in the /playsound command to the notes played by note blocks?

I just need to know how the pitch value in the /playsound command correlates to notes. e.g what note would this play? /playsound minecraft:block.note_block.bell block @a[distance=..30] ~ ~ ~ 100000 2 ...
-1
votes
1answer
59 views

Click text only once, not multiple times

I'm using the website minecraft.tools to help create a book, in which the user clicks the text and is given an item. I created the text that says "> Click for Reward" and added a Click ...
1
vote
2answers
60 views

How to detect for when there isn't a specific entity near a player? [closed]

I am trying to make a freestanding crawling system that works for multiplayer in version 1.15. I was wondering if there would be a way to summon an entity to the player when that specific entity is ...
2
votes
1answer
57 views

How do I prevent players from riding a donkey, but still be able to access its inventory? [duplicate]

I am trying to make a data pack in Minecraft 1.16 where you can equip gear without taking up space in the player's inventory. I have it set up that when a player holds a specific item, a donkey is ...
3
votes
3answers
112 views

Detect if all minecraft players are within a certain area

I am making an minigame, and I need to detect if all players are nearby I tried /testfor @a[r=10] but this returns true even if only one player is nearby How can I check if all players are near?
0
votes
1answer
30 views

Scoreboard teams gets cleared when a player moves

Players are removed from their scoreboard team on my Spigot server as soon as they move (this includes changing the direction in which they look). I run this command: /scoreboard teams join TeamName @...
0
votes
0answers
16 views

Is it possible to use the minecraft /setblock command in a random place? [duplicate]

I'm trying to make a command to give you a stick with knockback 50000 that uses the TNT yeeter mod for yeet sound and im using the /scoreboard objectives add block (random location) command_block{...
2
votes
2answers
83 views

NoAi Chicken won't activate pressure plate

I need help creating a device that sends "NoAI:1b" chickens over pressure plates to make music. Unfortunately, either the chickens are not technically touching the ground or some how the ...
1
vote
1answer
63 views

The repeating command block gives me a new bow when I try to shoot. How to fix that?

I'm making a Minecraft map and I don't want the player to be able loose his bow. So I wrote this command into a repeating command block: /replaceitem entity @p hotbar.0 bow{display:{Name:"{"...
0
votes
1answer
56 views

Ways to turn of a repeating_cb set to tp you away from it [duplicate]

I just added a repeating command block to an adventure map(1.15.2) I've been working on for awhile. It's purpose was to detect a falling player and then to tp them approximately 300 blocks away. I got ...
3
votes
2answers
87 views

How do I put a newline in an item name?

I am trying to give myself an elytra that is named like this: Rockets Rockets But the newline isn’t showing up. How do I make it show up?
0
votes
0answers
33 views

How do you make villagers run away from the player?

When you punch a villager, it would run away from you until it reaches a distance and calm down so chasing it is actually possible. I have my own solution for this where a baby zombie is constantly ...
2
votes
2answers
518 views

How do I make my Scoreboard not fall below 0? MCPE 1.6

The scoreboard I've made is called credits. I want people to have fun and buy items with it, but I've discovered that I can go below 0 with my credits, and that breaks everything because the other ...
0
votes
1answer
62 views

How do I send a custom Tellraw message based on the player in a certain location in Minecraft

For a Minecraft map I'm making, I want public messages to be sent when a player steps on a certain pressure plate or walks through a specific door, and for the message to say who exactly did it. Also, ...
0
votes
1answer
187 views

How do I fix a command generated by MCStacker? [duplicate]

I'm trying to make a map with a death-checker. I'm not a command pro, so I used MCStacker to generate a command. The below command is a function that I generated: give @p chain_command_block{display:{...

1 2 3
4
5
78