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.

519 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
2answers
206 views

(Java Minecraft 1.14) Loot table reward won't stack with /given item, even though they have the same nbt?

I have an item in a datapack which has a supplemental function to give it straight to the player (for testing), and an entry in a loot table (which is how survival players get it). I recently noticed ...
1
vote
0answers
192 views

(Java Minecraft 1.14) How to simulate overworld terrain generation?

I need to scatter a specific floating-island structure (stored in a structure file in a datapack) randomly throughout the overworld, so that there is one island approximately every 1000 blocks in any ...
1
vote
0answers
707 views

(Java Minecraft 1.14) Datapack scoreboard timer optimization?

Let's say that I have a scoreboard which acts as a timer for armorstands doing something. Every time an armorstand's value in the scoreboard gets to x (for now, let's say x = 20) the armor stand does ...
1
vote
0answers
42 views

Command Block Testfor

I play Minecraft 1.11.4 on my iPhone and am trying to find a way to make a gate work with command blocks, red stone, and a button on either side. I want to use a diamond sword with the custom name Key ...
1
vote
1answer
380 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 ...
1
vote
0answers
448 views

(Java Minecraft 1.14) How to remove a specific amount of hunger points from a player?

A heavily requested feature on a server I play on is Veinmeiner, however the server owner doesn't want to add mods. As a result, I'm writing a datapack for it. I've got most of it working, except for ...
1
vote
1answer
781 views

(Java Minecraft 1.13) How to summon a splash water bottle with no gravity?

Right now, I'm making a "Fire Hose" item which shoots splash water bottles. I've got the velocity and everything working but for some reason it falls much quicker than I expected, and the trajectory ...
1
vote
0answers
2k views

my Minecraft /tp command thinks there are “no entities” on my team

I'm having a problem with command blocks and teams. I am using Minecraft 1.13.2 and I am on my own public server. I have a command block that puts me on a team "player". (player is the actual name, ...
1
vote
0answers
60 views

Is it possible to set a map to a fraction ratio? (1/2 : 1)

Unlike most people, I want to create a map smaller than the average. I have a minigame on a server that needs a map. Is it possible to set a map to a fraction? Most maps are 128x128, I would like a ...
1
vote
1answer
886 views

How to program a command block to teleport if there is exactly one player nearby?

How can I program a command block (or a combination of blocks) to teleport nearby player only if there is exactly one player nearby? I.e. when button pressed, if there are more than one player within ...
1
vote
1answer
250 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:&...
1
vote
3answers
3k views

How to teleport an item to a player in Minecraft 1.13?

In Minecraft pre-release 3 I was able to run the command /execute as @e[type=item,name="Big Apple"] run tp @e[tag=bigapple] @s and it would find an item dropped on the ground named Big Apple ...
1
vote
0answers
128 views

How do I use attributeModifiers on Minecraft server?

How do I use attributeModifiers on a minecraft server? When I paste the command below the sword says it has the modifiers, but attacking something its like a normal diamond sword. LAN server works ...
1
vote
0answers
386 views

Minecraft Xbox One Edition /say command?

Im making a world in Minecraft that uses the command /say a lot. When I join the world, everything works fine, until I try to use the command /say in a command block. All the other commands work fine, ...
1
vote
0answers
755 views

How Do You Make Scoreboard Triggers Teleport People?

With the help of IronAnvil, I got some scoreboard triggers working for my server. All I need to figure out now is how to make it so the scoreboard triggers teleport you. Inside a repeating command ...
1
vote
0answers
131 views

Is there anyway to add the eating time

So I'm doing a Minecraft map and I'm trying to do a medkit. My plan is that when a player eats a steak they will get a X amount of health. But it would pretty OP if you could take a medkit in 3 sec. ...
1
vote
2answers
925 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:"...
1
vote
0answers
517 views

How to include team name of selected player in tellraw

I want to display a tellraw message which includes the team name of a selected player. Example: A player on Red team has reached x score! Something like {"selector":"@p"} but instead of ...
1
vote
1answer
569 views

Can't teleport mounted mobs and the mob mounted on

The current commands I have are: /summon wolf ~ ~1 ~ {CustomName:"test",CustomNameVisible:1,Tags:["test"],CollarColor:0,Sitting:0,Passengers:[{id:"wolf",CollarColor:0,Sitting:0}]} and /tp @e[tag=...
1
vote
0answers
580 views

Minecraft Functions in Craftbukkit server

I have a craftbukkit server running 1.12.1 with multiverse but cannot to get the new minecraft functions working. From the root of the server I have a directory /flat_world/data/functions/Hello with ...
1
vote
2answers
923 views

How to effect entities with a potion effect in a certain radius in MCPE?

So im trying to make a custom potion using an xp bottle, I'm using the command /execute @e[type=xporb] ~ ~ ~ effect @e[r=5] poison 5 2 true, I'm trying to make it where anything in a radius of 5 will ...
1
vote
0answers
532 views

Can scoreboards cause lag?

Can many scoreboard objectives (100+) cause tps drops (down to 4-5 tps)? I know in fact that command block systems on my server are what cause lag, bacause turning command blocks off in config removes ...
1
vote
1answer
933 views

Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction

I need some help with a cool command I'm trying to make using either 1 or multiple command blocks in 1.10. I'm trying to activate the sweepAttack particle based on the direction the player is facing ...
1
vote
0answers
65 views

How can you track missile damage in Minecraft?

I am building an RPG map for Minecraft and I have a system for rewarding individual XP by tracking the stats of mobs killed.I would also like to award shared XP (via scoreboard) for group kills ,i.e. ...
1
vote
0answers
207 views

Minecraft: Shift + Click (/replaceitem)

I have a fill clock and in a command block I have this command: /replaceitem entity @p slot.inventory.13 minecraft:spawn_egg And in the 13 slot there comes up an egg. What I want it to do is give ...
1
vote
0answers
120 views

ArmorStand Passenger on Squid sinks away from Squid

I need some help! I am using the command: /setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {SpawnData:{id:"Squid",Passengers:[{id:"ArmorStand",Invulnerable:1,NoBasePlate:1,NoGravity:1}]},SpawnCount:1,...
1
vote
1answer
333 views

Testing for structures near players

I want to have a redstone timer that has a signal into a command block, with /execute @a ~ ~ ~ testforblocks <Coordinate 1> <Coordinate 2> <Relative Position> and then a compartor, ...
1
vote
2answers
2k views

Using custom commands in Multicraft

I'm trying out using Multicraft to manage some aspects of my public server. There's a command option that is supposed to allow commands to be run by the web app when players type the commands into ...
1
vote
1answer
637 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 ...
1
vote
1answer
28 views

Minecraft give effect when stand on a certain block in a 10 by 10 range

I'm trying to make a base that that when someone enters it they get glowing so that I can see them. I don't want the effect to be permanent and the effect should be given only when being on that block....
1
vote
1answer
174 views

How to summon an invisible falling block in minecraft 1.16.5?

I'm trying to summon an invisible falling block using a repeating command block to get rid of the shadow created by it, I've tried using ActiveEffects NBT but that isn't seeming to work, here's the ...
1
vote
2answers
225 views

How to point a compass arrow to a certain player?

my cousin wants to play minecraft manhunt, but we play on ps4. I was wondering if we could use a command block to make a compass arrow point at a certain player.
1
vote
3answers
220 views

Minecraft replace command syntax error

I am using minecraft bedrock on my switch. All I want to do is to remove all the oak trees so am using the fill/replace command but all I get back is “syntax error: unexpected “minecraft:log”: at “05 ...
1
vote
1answer
129 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 ...
1
vote
1answer
1k views

Minecraft arrows with custom effects, choose what tipped arrow you shoot?

I'm building on a custom map and want to have custom arrows with special effects, like an explosive arrow, a thunder arrow and more... I know I can use tipped arrows with diffrent potion effects and ...
1
vote
1answer
152 views

How to get command block talking in chat to nearby players?

I'm trying to get a command block to write in the chat, and it is working, but it is displaying it to all players in the server. I only want the chat to appear to the player that steps on the pressure ...
1
vote
1answer
496 views

Minecraft Vanilla Warp Tools For Servers

I'm making a server that has Warp Tools. Warp Tools are written books with a content inside saying "Throw book to warp to ..." These books can be bought from my server shop. At first I made it so ...
1
vote
2answers
6k views

Commands to stop hunger depletion without constant refilling health?

I am looking to create an area where, when players enter it, their hunger does not deplete but they are not 'invincible' (super-fast regenerating health). I have tried: 1) /effect @a 23 1000000 1 1 ...
1
vote
1answer
136 views

Minecraft | Selecting the oldest target / one with the least score

On reddit, I saw this and decided to try and recreate it. It mostly went well, except there are still some issues with the selectors. Right now, I am spawning armor stands relative to the player's ...
1
vote
1answer
81 views

Can I test to see if a player has placed a bed without creating a scoreboard objective?

Can I test to see if a player placed a bed without setting up a dummy scoreboard objective to keep track of it? I am trying to pack only what I need into the size of a single structure block. Once ...
1
vote
1answer
553 views

How to Make Custom Colored Scoreboards

I am on the mchost.co server and I want to know how to make colored scoreboards on it for my Minehut server. How can I do this?
1
vote
1answer
210 views

Problem with execute command in minecraft

I am trying to run this command: execute @a[score_hammer_min=1,score_shift_min=1,score_attack_min=1,rx=74,rxm=90] ~ ~ ~ /summon LightningBolt ~ ~ ~ I have tried changing the variables around and ...
1
vote
1answer
47 views

How can I give players custom names?

How can I give someone on my Minecraft server a custom name that replaces their own username in that game?
1
vote
2answers
128 views

How can I remove a lot of items through commands when they give me immense lag when I near them?

Is there a command I can use? If so please let me know what it is. I have tried the following: /kill @e[type=minecraft:item,nbt={Item:{id:"minecraft:dirt"}}]
1
vote
1answer
121 views

How to change an entity's item value?

I want to summon a mob with a specific value, for example, I want to summon a zombie that had a RED concrete, but when I don't write the value, he spawns with a white concrete. So how can I summon him?...
1
vote
2answers
4k views

Minecraft windows 10 edition - Command Block question!

Just started playing Minecraft Windows 10 edition, and I'm having a lot of fun playing around with command blocks. I'm trying to build a store in which you trade 64 Rotten Flesh for 1 diamond. I've ...
1
vote
1answer
248 views

How do you testfor a specific player 1.11.2

I'm trying to make a V.I.P. door with a testfor to a specific player with this command /testfor @a[name=name,r=radius] I replaced the name with my user and radius with 10 and an error command pops ...
1
vote
1answer
190 views

How to clear only unnamed items

The title might be confusing but what I am trying to ask is say that you have two diamonds. One of them is named "Blat". How do I clear only the item that isn't named?
1
vote
3answers
941 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 ...
0
votes
1answer
20 views

How do I run a summon command based on the amount of HP the main mob has?

I have tried many lines of code, and none of them seem to work. This is the code I use to store the health score: execute as @e[type=zombie,limit=1] at @s store result score @s Health run data get ...

1 2 3
4
5
11