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
0
votes
2answers
45 views

How to get the id of a head

I am trying to give the nearest player a SCP-049 head but i don't know how to put it on them, and how to even give them the head. is there a way to find the id of the head so its easier for me? this ...
0
votes
1answer
19 views

Issue with a CanPlaceOn object for trade

I have this command /summon villager -179 64 95 {VillagerData:{profession:farmer,level:2,type:plains},Invulnerable:1,NoAI:1,CustomName:"\"Gardener\"",Offers:{Recipes:[{buy:{id:...
1
vote
2answers
783 views

How to make a Potion Spawner in 1.12.2?

I am making a map but there's a problem, how to make a Potion Spawner in Minecraft 1.12.2? I am trying to make a command : /setblock ~0 ~1 ~0 mob_spawner 0 replace {SpawnData:{CustomPotionEffect:"...
2
votes
1answer
54 views

How do I allow multiple keys to unlock a container block?

I am trying to make a container that unlocks for several keys, so far my testing says that only 1 key can be in place at a time. is there a way around this to have multiple keys? I'm playing Minecraft ...
0
votes
1answer
31 views

Tracking Kills/Deaths in Minecraft Bedrock

Since Bedrock only has dummy scoreboards, I'm trying to use command blocks to update the scoreboard. Is there a way to use /testfor or another command to look for stats like Death? are stats even ...
2
votes
1answer
522 views

Execute command as you drink a water bottle

I need to execute a command as I drink a water bottle. I have made a scoreboard already. scoreboard objectives add drinkPotion minecraft.used:minecraft.potion But, the execute command that I used ...
1
vote
1answer
280 views

Help using /fill command with NBT tags on spawners in 1.14

I'm working on a mob grinder, and have some spawners I need to place. However, I'd like the player diatance tag to be 1000, instead of the usual 16. I know it should look something like this: /fill ...
0
votes
0answers
27 views

Villager trade issue with canplaceon item [duplicate]

I have this command: /summon villager -179 64 95 {VillagerData:{profession:farmer,level:2,type:plains},Invulnerable:1,NoAI:1,CustomName:"\"Gardener\"",Offers:{Recipes:[{buy:{id:...
2
votes
1answer
67 views

I don't have the F3 button

I'm using a lenovo chromebook and this doesn't have the F3 button. So how should I show coordinates in Minecraft?
0
votes
0answers
29 views

How to register punch in minecraft? [duplicate]

Does somebody know how to register punch with commands? I want to execute a function when player punch other player or mob
5
votes
1answer
392 views

How would you copy a player's inventory into a double chest?

I am on a multiplayer Minecraft realm in 1.16 and I was wondering if there was any way to set a chest's Items to a player's entire Inventory including the offhand and armor slots. Using data modify &...
0
votes
1answer
616 views

How do I target a specific item on the ground?

I'm making a map and there's a waterfall that keeps spawning squids, I've got a repeating command block that kills the squid but they drop their ink sacks minecraft:dye 0 and it looks messy, What I ...
0
votes
1answer
25 views

How to limit a scoreboard team to have 1 player

I am trying to make teams that have a limit of 1 entity on them, for example, a game of hide and seek, where there is 1 seeker and 5 hiders. I need to have some of the teams in my world to have a ...
0
votes
1answer
209 views

Tellraw or a message in chat at a certain 𝑦 level in Minecraft Bedrock?

I'm making a world where the sun basically kills you and if you go above sea level during the day you'll die. The problem is that it's really easy to accidentally mine above sea level (whether it be a ...
0
votes
0answers
18 views

Execute one /data command for block entities of some kind within a range?

I know I can have one /data command target multiple entities of one kind in a given range like this: /execute as @e[type=some_entity,x=1,y=2,z=3,dx=4,dy=5,dz=6] run data modify @s Example It's a ...
0
votes
3answers
607 views

Teleporting type command doesn't work with @e

Whenever I type /tp @e[type=anything] @p it teleport all entities nearby and all my named entities, even though I've specified to teleport all cows, or minecart with chests, or whatever I put under ...
3
votes
2answers
47 views

What is the best way to replicate a region?

I make minigames, let's use the example skywars for right now. I normally recreate the maps (replace broken blocks, destroy placed blocks) with about 20 /clone commands. I have also been looking at if ...
-1
votes
1answer
23 views

Why this command does not work?

The idea is to replace the head slot of any armor stand with the tag Cookie if it has no player_head equipped (testing for item in inventory), it is basically for a infinite cookie machine. But the ...
2
votes
1answer
75 views

Maximum 1 entity per block

So when I break an oak_log block I summon an area_effect_cloud with the tag B.Spawn at the block I just broke. Then I use this command to summon a 3x3x3 area_effect_cloud cube around the [tag=B.Spawn] ...
1
vote
1answer
12 views

How do I only stylize parts of my tellraw command?

How do I make only the channel text blue, not the hashtag? /tellraw @a {"text":"# channel #","clickEvent":{"action":"open_url",&...
1
vote
1answer
944 views

How can I trigger a command when a player is hit by a Snowball?

I am trying to make a snowball that triggers a command when it hits a player in 1.15, but I don't know how to do that. When I do execute at @e[type=snowball] run gamemode spectator @a[distance=..2] it ...
2
votes
1answer
50 views

How do I detect certain block types anywhere in a certain area?

I want to make a command block that detects water blocks anywhere in my world, and then replace it with ice, but I don't know how to detect blocks without testing specific coordinates one by one. For ...
0
votes
1answer
23 views

Which command would I use to clear an area of one type of block in MCBE?

I'm trying to clear an area of stone and nothing else. Is there a command I can use for this?
2
votes
2answers
46 views

Custom Minecraft 1.8 spawners

I am working on a minecraft 1.8 server and am trying to make a mob spawner that spawns items. This example:How can I make a spawner that summons Items? works on new versions of minecraft but not on 1....
1
vote
1answer
124 views

Is it possible to change part of the NBT of a held item?

As the title says, I'm wondering about whether it is possible to change part of an NBT or add NBT to an item that a player is holding. My goal is to make custom enchants. For example when a player ...
1
vote
4answers
21k views

How do I test for a named item in a players inventory? (Minecraft 1.13)

So I'm trying to make a command that tests for a named item in a players inventory, and executes if they have that item. I know that you can test for an item type, but how do I make it test for a name ...
0
votes
1answer
69 views

Breaking multiple block types with one tool

I'm making a lumber tycoon in minecraft, and I have a command by the press of a button to take money from the player and give the product with the "privilege" to break logs, but it seems to ...
0
votes
1answer
27 views

Run command after 60 seconds + display timer for individual player when player presses button

My title almost explains everything I want to do. I want the player to press a button. Then the player gets an item from that but the player is only allowed to have the item for a minute, so I need ...
8
votes
2answers
596 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 ...
20
votes
5answers
11k 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 ...
1
vote
3answers
528 views

Player quit detection

I am trying to detect when a player has quit the server, I have the scoreboard to detect when a player quits: /scoreboard objectives add quit minecraft.custom:minecraft.leave_game However, the rest ...
2
votes
1answer
25 views

How do I “remember” a target for multiple commands?

Let's say I want to target the nearest player to 5, 5, 5 and teleport them to 50, 50, 50: /tp @p[x=5,y=5,z=5] 50 50 50 but then I want to /kill them (specifically in this order). This would not work: ...
2
votes
1answer
43 views

Force player to close their inventory

I want to either close a players inventory with a/some command(s) or detect when they don´t have their inventory open. I already know some ways to do this but they are not easy to use or near perfect. ...
2
votes
1answer
51 views

Hiding team colors in usernames

I'm working on a minigame in Minecraft that is built upon not knowing what role other people are (kind of like a social deduction game). However, since teams are required for the game to function, a ...
0
votes
2answers
70 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
1answer
35 views

How to place a sign with text using commands?

I am trying to make a shop with items that get increasingly more expensive, My problem is: How do I show the new price? This will be on a sign that I place, not in chat. Does anyone know how to place ...
1
vote
0answers
31 views

How to create team chats

I am currently trying to create team chats for different teams, but the /team command does not exist in 1.12.2 which, is the version i am trying to do this in. I want there to be a radio option, have ...
1
vote
2answers
49 views

How to display gamemode in Minecraft multiplayer server?

Is there any possible ways to display every players game mode on screen such as setdisplay function/command? This would be used so that server OP's did not cheat to get resources that they want.
0
votes
1answer
33 views

Why is my worn item detector not working? (1.15.2 Minecraft)

I have worked on creating an item that can make you fly by sneaking but the detector is consistently failing. It is a scoreboard system and this is the item NBT: leather_boots{display:{Name:"[{\&...
1
vote
1answer
120 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
0answers
13 views

Put players position on the scoreboard in bedrock edition

I've been searching for a while trying to figure out how to put a players position onto a scoreboard in Bedrock Edition, but I can only find stuff for Java Edition. I need just the x and z axis. I ...
2
votes
1answer
43 views

Why does /execute store refuse to update an NBT number when provided with a scoreboard value?

Here are some commands for you to try in MCJE 1.16. Run the following commands in the chat: Set up a scoreboard objective. (or use an existing test objective if you hate piling them up, like me) /...
0
votes
1answer
74 views

Is there any way to get a random item without naming every item in minecraft?

I just wanted to know if there is a way to get a random item without hundreds of commands.
0
votes
1answer
43 views

How to hide “No items were found on player [ign]” message in chat when using Citizens NPC /clear command [duplicate]

So I'm building a game for an event in about a month or so and I'm having different kits being given by NPCs (I'm new to event/game making so I'm doing the best I can lol if there's a better way to do ...
0
votes
0answers
47 views

why cant i break blocks in Minecraft but still kill animals? [duplicate]

see I am in creative mode and tried doing the mouse button 1 attack but that still didn't work, I am in creative mode playing with a friend, well at least trying. so I am in multi player, I also ...
0
votes
1answer
51 views

Force a falling block to place in Minecraft 1.16.4?

What is the best way to force place a falling block? In other words, is there a way to make a falling block place itself in the air? If so, what is the best way? I know you could use barriers under ...
0
votes
0answers
27 views

How to measure chunk inhabited time?

Mob spawning is affected by Local difficulty, which considers time inhabited in a chunk. How can I measure the time inhabited in a chunk? According to the chunk format it is stored in NBT data for ...
0
votes
1answer
29 views

How can I create different portals to different sky block islands for multiplayer?

I downloaded a sky block datapack and I want to create different portals to different sky block island for multiplayer. How can I achieve this?
2
votes
1answer
57 views

How to detect the item that is being “grabbed” by a player in the GUI?

In the GUIs of chests, furnaces, anvils, etc., or just your own inventory, you click on an item to pick it up, and click again to put it into a slot of your inventory or the container block. What is ...
1
vote
1answer
37 views

How to summon fishes with delay after player passes through a location in the sea?

I'm using Minecraft Education Edition. I want to summon 3 to 5 fish whenever a player comes closer to a location in the sea and I want it to put some delay for summoning too, for example: 3 seconds. ...

1
2
3 4 5
79