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", "minecraft-bedrock-edition", or "minecraft-education-edition" tag.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
17 views

Make an evoker with commands

I'm trying to make an evoker. I have enchanted a shield with a banner on it, but I cannot get the banner to work on the shield. Here is the command I am currently using: /give @p pillager_spawn_egg{...
user avatar
-1 votes
0 answers
44 views

How can I spawn a falling block moving toward where I'm looking?

I mean if a falling block (the entity) can be spawned but with a motion assigned to the front of where I'm looking: Example: I'm looking to the direction 90 ( ~x ~y ~z looking: 90 ~ ) then the block ...
user avatar
  • 1
-1 votes
0 answers
37 views

How to enchant a stick in Minecraft in bedrock edition 1.19? [closed]

How do you do it? Whenever I do it, it always denies.
user avatar
0 votes
1 answer
37 views

How can you make a ghost block in minecraft?

So, I forgot how to summon falling blocks, and all the videos were not helping. I'm not very good with the commands which involve using [, so if I could get an answer, that would be nice.
user avatar
  • 1
1 vote
1 answer
46 views

How can I swap between offhand and mainhand with commands?

Of course I know that if I press F key, offhand and mainhand's item swaps. But I want to do this with command. I tried: execute as @a[nbt={Inventory:[{id:"minecraft:snowball",Slot:-106b}]}] ...
user avatar
0 votes
0 answers
22 views

Show scoreboard belowname without a value

In my server I have set up a scoreboard system to show a staff tag under the staffs name, however, it doesnt quite look right with "1 Staff" under our names. Is there any way to remove the ...
user avatar
0 votes
0 answers
19 views

Is there a way to make a zombie that doesnt attack you but it attacks other players on java? [duplicate]

I like playing OP PVP with things like protection 22 armour and sharpness 25 swords, things like that, I like developing the armour sets more than actually using them, I was making a Kings Set that ...
user avatar
0 votes
0 answers
36 views

How to lock items into inventory/chest slots using NBT data in Java Edition?

It's a bit like Changing the NBT data of a variable amount of items in a chest inventory? but I want to do it using NBT data (like possible in Bedrock Edition) and without the need to set up a ...
user avatar
-1 votes
1 answer
34 views

Potion effect Giver from item frames

I remember doing this a long time ago with armor stands as it was the only entity to easily do it. I wanted to make an invisible item frame that gives the player jump boost when under the item frame. ...
user avatar
-1 votes
0 answers
47 views

Teleport command not working

I am participating for a Minecraft building competition, and I'm the command block maker. I wanted to make that at a certain place it will teleport people back to the platform. Here's what I wrote tp @...
user avatar
-2 votes
0 answers
26 views

Testing for specific item in specific hotbar slot?

I am working on a data pack to add airships into Minecraft 1.18.1 (based on re-textured donkeys). I am planning to make it so that the following behaviour occurs: If you hold the “Ascend” item, the ...
user avatar
  • 1
0 votes
0 answers
14 views

Is it possible to make using an item summon an entity in 1.17? (Java) [duplicate]

I'm planning on making an RPG game for my friends and I with custom items, but I'm not sure if it is possible to use the /execute command (or any command) to summon an entity when you right click with ...
user avatar
1 vote
1 answer
69 views

Stop a thief in Vanilla Minecraft: Detect if player is x distance from y,z coordinates

I'm trying to catch a thief in 1.19 Minecraft. I had one set of commands to see if items were taken out of a chest, but that was defeated -- I suspect they used X-ray hacked client to disable the ...
user avatar
  • 135
2 votes
2 answers
32 views

Can you make Ender Crystals do less damage?

I have been trying to find a way around Ender Crystal damage in my map I have been making. I want to make the Ender Crystals do less damage while keeping the overall player damage the same. My first ...
user avatar
1 vote
0 answers
26 views

How to set other player's armor in Minecraft

I'm making an MCBE behavior pack which adds kits via functions (functions are to be executed by command blocks). I want to make it so that the player doesn't have to equip armor; instead, it ...
user avatar
-3 votes
1 answer
43 views

How to remove all trees in Minecraft Bedrock Edition?

I'm looking to remove all the trees in my creative Bedrock world. Is there a command to do so? If there is, what is it?
user avatar
0 votes
1 answer
43 views

How to clone a structure with commands? [duplicate]

I made a house, and tried to clone the whole house somewhere like 511 blocks away. I made the house inside a red line to make the cloning process easier. But as soon as I pasted the coordinates to the ...
user avatar
0 votes
0 answers
19 views

Can I clone an area to the coordinates of an armorstand in 1.18.2? [duplicate]

I am making a map where, if you walk close to an armorstand, it disappears and clones something on the armorstand coordinates. I have already figured out a way for detecting if a player is near it and ...
user avatar
  • 1
1 vote
2 answers
50 views

Need help making a ground distance detector

I'm making a data pack where some players cannot take fall damage. I don't want to use resistance 5 or jump boost 255 as there needs to be PVP and jump boost 255 will launch you in the air with PVP. ...
user avatar
  • 13
1 vote
0 answers
65 views

How to make snow golems do damage?

I have a single player world, and I'm trying to make a game in which two players try to attack and destroy each other's bases (represented by and iron golem and a ravager in cages). I'm trying to ...
user avatar
0 votes
1 answer
48 views

Teleporting players when a certain coordinate is reached [duplicate]

I am trying to teleport all players who go to the Y level 8, but this command teleports all players from Y level 8 and the command block coordinates: /execute if entity @a[y=8,distance=..10] run tp @s ...
user avatar
  • 11
-1 votes
1 answer
62 views

Why won't this execute command work?

I'm trying to make a datapack and in it you cannot sleep unless you are y 100 or above, but my command doesn't work. Can anyone explain why P.S: playerheight is a scoreboard that updates according to ...
user avatar
  • 13
3 votes
0 answers
41 views

How do I prevent other players from taking items out of a dropper? (1.18.2)

I'm currently making a trading system on my Minecraft server. You drop an item that spawns a dropper with a small UI. There are 2 empty slots where both players will put a custom player head from ...
user avatar
1 vote
2 answers
30 views

Check the block connected that an item frame is connected to

I'm trying to check the inventory of a hopper that has an item frame connecting to it, however I can't even get it to say "hi". I currently have this: execute as @e[type=minecraft:item_frame,...
user avatar
0 votes
0 answers
28 views

How to tag a #log in 1.18?

I'm working on a treeAxe using commands in 1.18, but I can't figure out how to tag items that are logs and wood. Here is what have so far: tag @e[type=item,nbt={item:{id:"minecraft:acacia_log&...
user avatar
  • 1
-1 votes
1 answer
28 views

How do I make a villager that buys a custom banner

I want to know how to make a villager buy custom banners and I also want to know what the problem with my code is so that I don't make the same mistake again. This is what I typed: /summon villager ~ ~...
user avatar
  • 1
7 votes
1 answer
2k views

Is it possible to get the angle of the Sun to a block in Minecraft?

Minecraft has shadows in some of the shaders, and the shadows are obviously created via the positon of the sun or by timing. So is there a way to actually get this angle of elevation from the ground ...
user avatar
  • 356
1 vote
1 answer
38 views

How to give a player a specific item in a specific location? (Java Edition)

I started playing Java Edition months ago after being a Bedrock player for so long. Since I'm new to Java, commands are still pretty fuzzy to me. In this question, I'm trying to reaccomplish what I've ...
user avatar
2 votes
0 answers
78 views

Proper path to modify villager anger?

I would like to make villagers angry on command. I assume I need to use /data modify, but I do not know the proper <targetPath>. I have the following so far: execute as @e[type=villager] run ...
user avatar
  • 785
1 vote
0 answers
56 views

/execute working in command line but not in command block

I'm new to commands, so it's very likely that I'm missing something obvious. I'm trying to teleport myself from the Overworld to specific coordinates in the Nether. The command works in the command ...
user avatar
-1 votes
1 answer
75 views

How to turn sand into grass in Minecraft? [duplicate]

How would I turn sand blocks into the grass block on Minecraft? Please help.
user avatar
1 vote
1 answer
73 views

How to make zombies not attack a specific person?

I want to make a role-play world with my friends and one of them wants to be somewhat immune to zombies, but I have no idea how to do that.
user avatar
1 vote
1 answer
71 views

How do I test if a player has an item with a custom name in inventory WITHOUT scoreboards?

I'm trying to test if a player has an item named "sunny", and if they do to have it turn into a shulker box. If you could include the shulker box having a torch named "sunny" that ...
user avatar
0 votes
0 answers
23 views

How do I set the players health to scoreboard value? [duplicate]

I am trying to set the player's max health to my scoreboard value, this is the command I am using but it only says "GotStung has 20 [Hearts]" /execute as @a store result entity @s minecraft:...
user avatar
2 votes
0 answers
41 views

Testing for if an item entity has an ID matching a list of item names

I am making a datapack that uses copper as a fuel, however part of that means that I need to be able to test an item when it is on the ground to see if it is one of the 37 copper items. I have already ...
user avatar
  • 101
1 vote
0 answers
24 views

Replaceitem not working on Bedrock

For some reason, if I try using /replaceitem it won't execute the command inside of a command block. This is the command I used: /replaceitem block -10 -58 -27 slot.container 1 ender_pearl 1
user avatar
  • 51
1 vote
1 answer
41 views

Red wool command not working

I am trying to make a mini-game on Minecraft bedrock. In the mini-game different blocks that you place activate different things, but when I tried using the red wool command it kept telling me there ...
user avatar
3 votes
1 answer
56 views

Tag for items not burnable in lava (like netherite)

Nice and simple. What is the tag for items to be not burnable in lava, like netherite ingots? Or how would I make other items like obsidian not burn?
user avatar
  • 785
0 votes
1 answer
54 views

Command is running weirdly from load.json (datapack)

Could someone help me? I am thoroughly confused. I have a command in my datapack that is executed from load.json function: execute unless entity @e [type=armor_stand,name=team_lives,scores={...
user avatar
3 votes
1 answer
55 views

How to make a trident reach further underwater in Java Minecraft?

I'm looking for ways to make a trident reach farther underwater in Java Minecraft. Currently, I think the grind was way too hard to get a very mediocre underwater boost, compared to just swimming with ...
user avatar
  • 193
0 votes
1 answer
127 views

How to detect a held enchanted item using commands in Minecraft 1.18.2? [duplicate]

For context, I don't think the riptide enchantment gives a player enough speed or distance underwater. I mostly wanted to use it for fast water travel without a boat. I've found that giving a player ...
user avatar
  • 193
1 vote
1 answer
182 views

How do I make a boss bar for a mob and have command blocks execute when it gets to a certain health

I'm building a boss fight for a game I'm making, I want the boss to have a health bar at the top of the screen like the Ender Dragon/wither, but the boss bar will not connect with the boss's health. ...
user avatar
0 votes
1 answer
136 views

How do I summon an enchanted item? [duplicate]

I tried this command: /summon item ~ ~ ~ {Item:{id:iron_pickaxe,Count:1,Enchantments:{id:fortune,lvl:1}}} But the Iron pickaxe was without enchantment. I'm on Minecraft java 1.18.1.
user avatar
1 vote
1 answer
113 views

How do I make a boat with no gravity and have ice appear below it every second?

All I have is: /summon Minecraft: Boat ~ ~ ~ {NoGravity:1,CustomName:Name,CustomNameVisible:1} How do I add ice under it every second?
user avatar
1 vote
1 answer
52 views

How to make a zombie killing detection scoreboard work for a certain gamemode? [duplicate]

I'm trying to make it so that when it becomes night, a zombie spawns no matter what at a certain coordinate (which I've managed to do with the simple help of the player having to press a button to ...
user avatar
0 votes
1 answer
125 views

How do I make custom player heads have a NBT tag with commands?

I'm trying to put a CanPlaceOn NBT tag on a custom player head and I don't know where to put the tag. I tried /give @p minecraft:player_head{{CanPlaceOn:["minecraft:stone"]} display: {Name:...
user avatar
  • 1
0 votes
2 answers
62 views

How do make water poisonous, but also resistible?

I was wondering how to make all water completely poisonous in Minecraft 1.18.1; as in, give you wither. My current command (gotten from Google) is: /execute @a ~ ~ ~ detect ~ ~-1 ~ Minecraft:water 0 ...
user avatar
0 votes
2 answers
64 views

Storing a player's location and teleporting the player back to it later in Java Minecraft

I'm looking for a way to store a player's current location (probably in the scoreboard as separate X, Y and Z) and teleport the player to that location later. I'm not completely familiar with the ...
user avatar
  • 193
0 votes
1 answer
56 views

How to make a command set the time to day if it is night or night if it is day?

My friends and I are coding a sandbox game in Minecraft. Instead of using the default daylight cycle, I want to make a button that causes the time to change. Of course, I could simply make two buttons,...
user avatar
1 vote
1 answer
44 views

How to create a delay between two chain blocks? [duplicate]

My friends and I have been making a game in minecraft (java edition), and I want a title to say "Welcome", and then "To our game" after about two seconds. I created two chain ...
user avatar

1
2 3 4 5
97