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
1
vote
1answer
28 views

Is there a way to freeze the mob inside a spawner?

The question is pretty straight forward. Is there a way to freeze the mob inside the spawner. I think before 1.13 you could do RequiredPlayerRange:0s. Well, that's not working anymore (1.15) Is this ...
0
votes
1answer
42 views

How can I make an execute command there is a player looking at another player?

I want to make an execute command execute if any player is looking at any other player. I haven't been able to find anything about this online, so I am wondering if it is possible at all. I've tried ...
1
vote
1answer
25 views

Test to see if chest minecart has specific item

I'm building a minecart system for multiple players and stations. When a player drives a minecart, a writable book sets the destination. If the car runs over a detector rail, a command block checks ...
0
votes
1answer
20 views

How to add to a score number of certain item

I have a score named "DirtCount", I want to add the number of dirt in my inventory to the score. I found this command that sets the score to the number of dirt : /execute as @p store result score @s ...
0
votes
1answer
24 views

Mob in distance 1.15.2 [duplicate]

Im using this command: /execute if entity @e[type=minecraft:zombie,distance=100] run say HEY! ignore the say part, but I want it to detect a zombie in a radius from the command block, logically this ...
0
votes
0answers
20 views

How do I use setblock with a coloured sign? [duplicate]

I'm trying to create a 1 command block house for a datapack function (as I'm learning how to create datapacks) and I want a sign in the basement of my house however I can't get the sign to be coloured ...
3
votes
2answers
40 views

How can you detect the fractional part of the player's y coordinate? [1.15]

My goal is to be able to detect if the fractional part of the player's y coordinate is within the ranges: .0 through .4 .41 to 0.5 .51 to 1 So for example, if the player is at y-value 64.375, this ...
0
votes
1answer
57 views

I accidentally summoned way too many entities, now the world won't load

I messed up when typing a command into a repeating command block, and accidentally summoned a bunch of armor stands, all of which were being executed to summon fire arrows every tick. There were so ...
0
votes
1answer
36 views

Is it possible to speed up the way mob spawners spawn mobs?

I think the title is pretty self descriptive but if it changes anything my goal is to spawn villagers. Does anyone know any commands or tactics to make the villagers spawn faster?
0
votes
0answers
23 views

Minecraft: Can you kill yourself while rightclicking an Item? [duplicate]

I hope my title is self-explanatory. How can i kill a player, if he is rightclicking an item in minecraft? Is this even possible?
-2
votes
1answer
21 views

How do I set every players Exp based on a scoreboard of Kills in 1.16 snapshots

I am trying to make it to where when say, a player kills another player they will gain 1 EXP whole level for every kill. I've already made the /scoreboard for player kills and just need to make the ...
1
vote
0answers
31 views

i want to identify the coordinates of each of a specific type of block in minecraft

I'm creating a wave rush world where every night, enemies spawn from mob spawners and attack you. I found a cave system and placed mob spawners all over it, but now I need help to find all of them ...
2
votes
2answers
68 views

Is there a way to kill all players not in a minecart in Minecraft?

I am building a musical chairs Minecraft map, and I was wondering if there is a way to kill all players who aren't riding in a minecart?
0
votes
1answer
34 views

Minecraft Inventory Testing

How can i test for a item with a Color, or bold, etc Name in Players inventory? Ist work only with names without Color, but I want Color/bold items to test.
-1
votes
1answer
41 views

How to clear a specific amount of items from inventory in Minecraft 1.15.2 [duplicate]

I've seen this question answered in many ways but not for 1.15. I want to be able to clear a certain amount of items (let's say 45 stone) from a players inventory. How do I make it so the command only ...
0
votes
0answers
29 views

Clear player inventory when leaving a specific world

I'm admin of a 1.15.2 spigot server on Minecraft java edition. I manage worlds with MultiverseCore and AdvancedPortals. I made a "creative" map where players can go to build anything in creative mode ...
-2
votes
1answer
40 views

Making custom pets

I need to make custom pets that I can build in my server, is there a way to do that? I tried to use a wolf and it works but I want to BUILD my pet, is there a way to like shrink my build? Edit: Ok so ...
0
votes
1answer
33 views

Minecraft: Using testfor to find a player who has left a zone (1.12.2)

I have Minecraft 1.12.2 (for Java Editon), and I'm trying to make a contraption that will keep spectators of certain levels within a certain area. I already have something that works, but it only ...
0
votes
1answer
40 views

Run a command, when a player has turned a certain page in a book

I want an command to be executed in minecraft 1.15.2 [Java-Edition] when a player has turned a certain page in a book. I am currently using the following command for this in a repeating command block ...
0
votes
0answers
37 views

Failed to execute 'execute' as Player_example

I have been trying a command to ride the Ender Dragon in Minecraft Bedrock Edition 1.15.2, and my second command block, a chain command, says Failed to execute 'execute' as Player_example. The ...
0
votes
1answer
20 views

How to execute a command at an random entity

im creating a rpg map and im going to use armor stands to randomly generate the dungeon rooms, but as i noticed, you cannot use this command: execute at @r[type=armor_stand] run ... I have no idea ...
1
vote
1answer
65 views

Unable to remove itemframes with items in it

To be unable to remove item frames with items in it has been a problem in my world for a long amount of time; I have a world that is about 4-5 years old and updated to the newest version. I can remove ...
0
votes
1answer
30 views

How do I make a specific scoreboard for mob kills in bedrock edition

I am trying to make a mob arena. The arena is already built obviously. I'm just trying to figure out how to make a working scoreboard for different mobs. I saw a few people mention changing the loot ...
1
vote
1answer
33 views

Scoreboard of how many chicken players kill

I tried this: /scoreboard objectives setdisplay list minecraft.killed:minecraft.chicken But it doesn't work. Any ideas?
1
vote
1answer
13 views

Minecraft Losing lots of ticks on commandFunctions

Hi I'm losing a lot of server ticks to these commandFunctions. Commandblocks are not enabled so it could not be anything like that. Anyone knows what is going on or how I can get rid of it? Plugins: ...
1
vote
2answers
133 views

How do I execute for a player wearing armor with a colored name

I am working on a command block contraption on my server that involves armor giving you certain potion effects. /execute if entity @p[nbt={Inventory[{Slot:100b,id:"minecraft:leather_boots",tag:{...
-1
votes
1answer
32 views

Renaming items with the /give command in Minecraft PE [duplicate]

I can't figure out how to get an item that is renamed using the /give command and I have tried the command I found here, /give @s stone 1 0 {display:{name:"name"}} but it keeps saying that I am ...
0
votes
1answer
21 views

Control flower, grass,.. spawning on one block

When you place a flower it is placed on a block randomly(little bit on a right, to a south,etc.).Is there a way to make a flower be placed at a exact location on block that you want to (let's say on a ...
0
votes
0answers
27 views

Minecraft: Give player score based on item equipped [duplicate]

Im working in a rpg map and i use scoreboards for strenght, intelect, talent, etc. is it possible to give a player a score if the player is using a specific item? (armor equipped or item in main hand/...
1
vote
1answer
24 views

Make an entity follow the player, but offset

Is there a way to use commands to take the Motion data from one entity and merge it onto another? I want to let another entities move in unison with the player. Just copying the Motion tag does not ...
0
votes
0answers
17 views

I need a Custom crafting with the option of destroying specific blocks (Canbreak command) [duplicate]

I need a Custom crafting with the option of destroying specific blocks (Canbreak command) I need this creation but with the addition on the created object status "canbreak oak_log" "type": "...
0
votes
1answer
66 views

Minecraft Bedrock Testfor Command

I play on the Bedrock edition and I'm looking for an easy way to find and count Eyes of Ender inside portal frames. My initial thought was to use testfor but I can't seem to get the coding right. This ...
0
votes
1answer
62 views

How to summon villager with locked trades in Minecraft 1.14, 1.15.2, or 1.16

I want to make villager that has locked trades. I would use it in maps, but i have unfinished map for 1.16, and when its done I'm going to make map for 1.14 or 1.15.2 (Not sure for version I'm going ...
0
votes
1answer
53 views

How do I test if a specific player is online?

I want to make a command block that detects if me or my friend are online using /execute. How can I accomplish this?
0
votes
0answers
18 views

How can a non-operator player run this command by clicking on a clickable tellraw text in 1.13+? [duplicate]

My command is something simple: /tellraw @a {"text":"Test","clickEvent":{"action":"run_command","value":"/scoreboard players add Jimmy test 1"}} The issue is that if a non-operator clicks on this text ...
0
votes
1answer
47 views

Is there a way to detect a player with relative coordinates to the command block?

Using the command: execute if entity @p[x=21 ,y=56 ,z=-132 ,distance=..4.5] works but won't work if I use relative coordinates. e.g. command:execute if entity @p[x=~ ,y=~ ,z=~ ,distance=..4.5] I need ...
-2
votes
1answer
46 views

Setblocking GUI

I am making a really cool MC map for java and I was wondering as I was making some kind of firework show, is it possible using commands to setblock GUI blocks that have stuff in them? For Example, ...
-1
votes
1answer
30 views

Using /data and /execute to find the nearest player's selected item's enchantments? (1.16 snapshots)

Very long post ahead. I'll place a tl;dr at the bottom for those who want/need. I'm attempting to create a "chunk buster" TNT bomb that will blow up a 16x16x16 area, starting from the block of TNT ...
-1
votes
1answer
51 views

How to give an enchanted golden shovel to players without an enchanted golden shovel? (spleef)

I am currently working on implementing a Spleef gamemode into a server I have, and I was wondering how to automatically give players shovels, while also not bombarding them with new shovels. I was ...
0
votes
1answer
20 views

Seek players near command block

I am trying to send a message to all players that are less than 20 blocks from a command block. I tried this at first: tell @a[distance=20] Hello But in the "Previous output" field I can see: [20:...
1
vote
1answer
20 views

Is there a way to have an item which can break SPECIFIC BLOCKS with SPECIFIC FACING?

I know it's possible to make block breakable by items, but I wonder if I could make an item which can only break the specified blocks if they're facing a given direction.
1
vote
1answer
30 views

How to add scoreboard value to a certain item entity [post 1.13]

I have a command, what sets the score of an item entity dropped by a mob. /scoreboard players set @e TMNextStage 1 {Item:{id:"minecraft:flint",Count:1b,tag:{display:{Name:"TMNextStage"}}}} What is ...
0
votes
1answer
40 views

Falling blocks don't work for me

I'm trying to make a fire ability for something I'm making that will summon falling fire blocks, and I'm having issues with the fire disapearing. I'm using /summon minecraft:falling_block ~ ~ ~ {...
0
votes
1answer
87 views

How to test for an item with custom model data in Minecraft

I havent done stuff with command blocks for a while, so I'm a bit rusty. I'm trying to make something with a wand in it and I'm using a custom model for the wand. I want to test if my selected item is ...
-1
votes
1answer
48 views

Setblock Command not working with specific parameters in Minecraft [duplicate]

I am trying to make a game for myself and my friends to play, and I have a prototype working in my test world that works perfectly, however, the game relies on the fact that we will be playing on a ...
1
vote
2answers
54 views

How can I /give myself a stone axe that can only break oak signs and oak planks in Adventure Mode? [duplicate]

I am trying to obtain a stone axe that destroy oak signs and oak planks in Adventure Mode. The command that I have tried is: /give @p stone_axe 1 0 {can_destroy: {"blocks": ["oak_sign","...
1
vote
1answer
24 views

Entities facing xz coordinates only (1.15.2)

I want to rotate an armor stand wherever I am located. And I can do that through this command: execute as @e[type=armor_stand] at @s run tp @s ~ ~ ~ facing entity @p But I want it to face my XZ ...
0
votes
3answers
70 views

How to automatically set time to day with command blocks

I have made an iron golem farm in 1.15.2 which only works if the villagers can sleep once in a while, but I have lit all of the caves in my area and I can't stand it being night. I am looking for a ...
1
vote
1answer
137 views

Is it possible to make everyone die once one player dies in Minecraft Bedrock?

I recently watched a Slimecicle video, that took place in Minecraft Java, which kills everyone in-game when one person dies. I saw someone got an answer to pretty much the same question, but they had ...
-1
votes
1answer
15 views

Talking NPC-s with commands post 1.13 [duplicate]

I have been developing an adventure map in 1.12.2 for quite some time, and decided to upgrade to 1.13+. I created NPC-s who talk when the player approaches them. It works this way: /execute @e[tag=...

1 2 3
4
5
74