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
20k views

How do I detect if players have sufficient EXP levels?

I want to make an XP shop but I'm not sure about how to detect if people have sufficient XP Levels. Can anyone help me?
2
votes
2answers
423 views

Minecraft World Loaded Detection Using Redstone (Save file load detection)

I've been trying to search for an answer to this question for some time now (World Load Detection / Chunk Load Detection / Join World / etc) However, despite my effort, I've been unable to find a ...
1
vote
1answer
723 views

How do I make a command block say the nearest player's name in chat in MC Bedrock Edition?

I'm working on a map in Bedrock Edition, and I need to have a command block at the end that says "Congratulations [player], you win!" Because it's a map, I cant just have it say a specific player's ...
1
vote
1answer
862 views

How do I test for a mob, with a given name, in a certain location?

I want to testfor a sheep, by the name of Lamb, in a certain location using coordinates. I have already tried this: testfor @e[x=999,y=80,z=-1034,type=Sheep,name=Lamb] But it doesn't work. I have ...
1
vote
3answers
2k views

How do I make a Villager Trade a Spawn Egg

I am trying to make a Custom Trade on a villager. I need to make him buy 8 gold nuggets and sell a Cow Spawn Egg. basically you pay 8 nuggets for a Cow Spawner. The ID of the Cow Spawn Egg is 92 but ...
0
votes
1answer
315 views

Tellraw problems in 1.9

I have two tellraw commands /tellraw Froggygamingmc {text:"Thanks For Using",color:red} and /tellraw Froggygamingmc {text:"Vend U.S.A.",color:green} but whenever I execute them it says Invalid ...
0
votes
2answers
7k views

Is there a way to make a visible health bar for mobs other than ender dragons and withers?

I would like to create other mobs that have health bars like the ones you see when fighting withers or the ender dragon; or like name tags that have health displayed. I want it to work for Minecraft 1....
0
votes
1answer
204 views

Generate a command block with variable data

I'm trying to setblock a command block with variable data in it. I want to make a variable sized array with an armor stand, and read a custom tag at a variable position. This position should be stored ...
-2
votes
2answers
284 views

How can I intercept an item being crafted and replace it with something with a 'canplaceon' tag? [duplicate]

I want to detect when someone is building a lever, then replace it with another lever that has the canplaceon tag so it can be placed on a redstone_lamp How can I clear the crafting item and replace ...
12
votes
5answers
5k views

How would I make something spawn when and where a snowball hits something? [duplicate]

I know how to make things spawn as they follow an object, but is there any way to make them spawn once lets say a snowball hits its target? I am working on a way to make snowballs that spawn tnt upon ...
8
votes
2answers
595 views

How do I output a scoreboard value or a selector to chat in Bedrock Edition?

JSON text format in Bedrock Edition is very different from that in Java Edition. The possible elements to go in the {"rawtext":[]} component are: text translate with (args) As you can see ...
8
votes
3answers
681 views

How can I detect when a player breaks a mob spawner?

I am working on a map that I want to test if a player breaks a spawner. Then it gives the player a spawner, and maybe some XP. I want to use a scoreboard command, but /scoreboard objectives add SB ...
7
votes
2answers
1k views

How to calculate player health percentage?

I have created the following objectives: health - health health1 - dummy (used for health*100) healthPerc - dumny (used for health1/20) The only problem I'm having is that when I do: /scoreboard ...
6
votes
5answers
56k views

What are the commands for the LAN world?

I've figured out that if you do /spawnpoint it changes your spawnpoint for the LAN world. So every time I die, I spawn where I want to. And I don't have to use my bed! I'd like to learn other commands,...
6
votes
4answers
2k views

How to change sign text color in Minecraft?

I have gone through every single website and video to try to make a sign with colored text, but nothing works. Can anyone help me to get a sign to say: Place Block(dark blue and bold text) I really ...
6
votes
3answers
1k views

Why can't I paste § into a Minecraft command?

According to https://minecraft.gamepedia.com/Formatting_codes, using §1 in an item's name should make the text colored dark blue. However, when I copy-paste a command like this one into chat: /give @...
5
votes
2answers
712 views

How many entities in an area?

I want to make it so I always have 50 entities in an area. So when 1 dies/despawns/leaves the area I want it to detect that and summon in a new entity, and yes I do want them to die/despawn/leave the ...
5
votes
3answers
24k views

My name includes space - How do I enter my username when typing command?

My username in Minecraft is sun solar arrow. This name includes spaces. Situation - When I want to get OP privilege, a user who has OP privilege will enter: /op sun solar arrow But my username ...
5
votes
2answers
13k views

Shoot bows faster by drawing faster

Is there any way that I can make bows shoot faster? The attack speed modifier will allow me to make them hit faster, but that doesn't really help. I'm trying to make it so that people with a "Ranger" ...
5
votes
2answers
798 views

Is there a way to break (like with a pick) a block with a command? [duplicate]

I'm looking for a command that would (possibly indirectly) break a chosen (arbitrary type) block, as if hit by player with a hand long enough - dropping the item, dropping contents if it's a container,...
4
votes
3answers
3k views

How to make a teleport command that does not work in the Nether?

I have a vanilla server 1.8.7 that uses a book to tp players to spawn or to their home (an invisible armor stand with their uuid connected to it). Problem is, if they set home (place their armor stand)...
4
votes
1answer
9k 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.
4
votes
1answer
259 views

Minecraft 1.14.4 dynamical sized integer array

I'm trying to make a dynamical sized integer array in Minecraft 1.14.4. I've already tried different ways, but the problem was with all of those solutions, that I had to summon one entity for each ...
4
votes
2answers
7k views

How can I paste commands on Minecraft Command Blocks?

So I have a mac computer but i plugged in a windows keyboard in my mac. I am still trying to figure out how to paste commands into a command block. So how can I paste a command?
4
votes
2answers
645 views

How to run a command (using /execute) based on a player having 7 or more xp points in Minecraft?

I'm trying to build a datapack that lets you craft xp bottles from glass bottles at the expense of 7 xp per bottle (because they drop 3 to 11 xp so the average is 7). I have almost everything working ...
3
votes
1answer
366 views

How to get player with highest, second highest, etc. score?

I'm trying to make an event for a server. The goal is simple, you have to do as many tasks as possible before the timer runs out. I already figured the timer out. However, here's the catch. I want to ...
3
votes
3answers
3k views

Can destroy command to destroy a certain type of block

Is there a way to destroy a certain type of block (ie. Oak wood planks) The command I've got so far is: /blockdata ~-1 ~ ~ {Items:[{id:wooden_axe,Damage:#,Count:1,tag:{CanDestroy:["minecraft:planks 0"...
3
votes
1answer
9k views

How to execute op level commands for non-op players with command signs?

After learning how to make signs that run commands when you click them, I have relied on them a lot with my Minecraft server. Most of the teleporting stuff and /say stuff use them. They were working ...
3
votes
1answer
856 views

How to stop thrown eggs from spawning chickens?

I'm using retextured snowballs and eggs for the different paintballs for two teams in a paintball map, so I can't replace the eggs with snowballs. I have tried using /gamerule doMobSpawning false, ...
3
votes
4answers
626 views

How to delay command blocks until player respawns?

I have a command block line set up so that it detects for a players death, then gives them weakness for 600 seconds. It applies weakness to soon before they get out of the respawn time. If there is ...
3
votes
1answer
10k views

Random spawn for multiplayer Minecraft server

I want to know if there's a way I can set it so that on first join, a player gets teleported to a random location on the map automatically. Then if the player dies without having a home set, they are ...
3
votes
1answer
170 views

How do I summon a villager with a certain profession?

In Minecraft Java Edition, you can specify the profession of a villager you summon using the VillagerData NBT tag. For example, the below command spawns a librarian villager: /summon villager X Y Z {...
3
votes
1answer
2k views

Is it possible to display output of /data from a command block?

I'm playing 1.14 and wanted to test some villager mechanics in a creative world. To help debugging I thought it'd be a good idea to constantly print the home/workplace information of the closest ...
3
votes
1answer
1k views

Deny items to be removed from inventory slots.

Is there a way to disallow players to remove a certain item from a certain inventory slot. What I have tried is to add a curse of binding to the item as following: /replaceitem entity @p slot.hotbar....
3
votes
2answers
331 views

How do I give myself a potion or tipped arrow with an effect?

In Java Edition, I can give myself a potion with effect with an NBT tag: give @s potion 1 0 {Potion:"minecraft:regeneration"} However, I cannot do this in Bedrock Edition, as there is no ...
3
votes
4answers
820 views

How to select entities not within a given cylinder in minecraft

I built a flat circular plane in minecraft, and am trying to force players to remain within this area. The circle is 161x161 centered around 0, 44, 0. I then placed a command block at the very center, ...
3
votes
1answer
798 views

Mob Spawners Survival 1.14.4

I'm trying to use a give command in a Survival world about mob spawners like a blaze spawner. When I place it in Creative, it spawns blazes, but in Survival just pigs! How can I fix this, without mods,...
3
votes
2answers
3k views

Clear named (and lored) item from players inventory 1.13 [duplicate]

In 1.12, the command: clear @p paper 0 1 {display:{Name:"[Winning Ticket] Musical Minecarts",Lore:[" Take this ticket to the reward "," collections at the entrance of the ", " Games area to claim ...
3
votes
1answer
2k views

Break blocks in adventure mode

I've been using the /give @p minecraft: diamond_shovel 1 0 {CanDestroy: ["minecraft: sand", "minecraft: grass"]} command to destroy blocks in adventure mode, but now I need the pickaxe to break all ...
3
votes
1answer
1k views

How to kill a player when they touch a block?

I am making a multiplayer parkour map on bedrock edition, and I have it set up where when a player steps on a grass block they die. But when a player steps on a grass block it just kills anyone who ...
3
votes
3answers
703 views

(Java Minecraft 1.14.3) Can a bossbar show different values to different players?

I would like to use a bossbar, with value set with execute store result bossbar, to hold the 'mana' value for each player in my datapack (which is held in a scoreboard so it can be manipulated in the ...
3
votes
3answers
12k views

Why is this command deleting all entities?

I'm trying to remove a specific, named, item if it is dropped on the floor. I have the following on my command block: kill @e[type=Item] {Item:{tag:{display:{Name:"RedFlag"}}} But it's removing all ...
3
votes
6answers
62k views

is it possible to spawn wither skeletons using commands?

The annoying thing about wither skeletons is: There is no way I know of to spawn them in the overworld! I have determined that there is no way to spawn wither skeletons in the overworld without ...
2
votes
1answer
464 views

Inside and Out radius? [duplicate]

I think there is a way to do an inside radius, and an outside radius, but how? I want to have a spawnpoint, where @a[r=30] is in gamemode a, and everyone outside is gamemode s. How would I write this?
2
votes
1answer
216 views

How do I execute a command relative to an entity in 1.15?

Already found similar posts like (How to execute a command relative to an entity), but those are some years old already and very outdated, what would be the new way to use the execute command relative ...
2
votes
1answer
166 views

How do I target players with only a certain X, Y, or Z coordinate?

I am trying to test for any player that is on Y level 118. Here is the command I am using: /testfor @a[y=118] The problem is, the command isn't working as expected. In my chat when I type this ...
2
votes
1answer
487 views

How to execute at the same height as an entity?

My problem is that I want to give every player on the same height as an area_effect_cloud within a radius of 25 blocks a scoreboard called 'stunned'. The command for that would look something like ...
2
votes
1answer
251 views

Double Speed Arrows

I'm trying to make whenever an arrow is shot it will fly at double the speed without falling. The no falling part was easy, simply did execute as @e[type=arrow] run data merge entity @s {NoGravity:1} ...
2
votes
2answers
3k views

How would one testfor a block placed?

I'm creating a map where the player gets four pieces of wool ( Red Black Blue Green ) and I need it so if they place the block anywhere it will trigger a command block. I have tried: /testfor @a {...
2
votes
1answer
57 views

Why does pasting a command into the chat return an error?

I am running a server on version 1.16.1 and I'm trying to run the following command which I copied and pasted from a command generator: /tellraw @a ["",{"text":"Co-op >&...

1 2 3
4
5
10