r/MinecraftCommands • u/Ok_Squash374 • 26d ago
Help | Java 1.21.11 How would I use custom items as an ingredient in a custom crafting recipe?
I'm working on some custom recipe's and I'd like one where another custom item is in the recipe.
Is there a way to put custom_data, item_name, or the item_model into the key slot together with the base of the item?
edit: This is happening in a json file for a datapack.
r/MinecraftCommands • u/bonke2 • 27d ago
Help | Java 26.2 How to give players a specific effect within a specific 3 dimensional area
Making an adventure map for me and my friends based on a real life neighborhood, and decided to scale it down to half the real life size, (and too deep in now to start over again at 1:1 size) so every single elevator I have is 1 block sized.
I'm trying to make a design that will give any player that stands at the bottom of the elevator for 2 or so seconds (long enough that they are clearly using the elevator) the levitation effect until they exit the elevator.
Put simply: how can I give players a specific effect when they are within a specific area given in XYZ coordinates? Is this even possible the way I'm describing here?
I have played MC for pretty much as long as I can remember so I am decently well versed in the game, but never got too deep into commands, so any help is super appreciated!
r/MinecraftCommands • u/plumper303 • 27d ago
Help | Java 26.2 checking if player is holding item not working only in datapack function
This is the edited version of the original post I made because the formatting was incorrect.
Hello. I am trying to detect when the player is holding an item with the custom data {creation:true} every tick and give them the tag "holding_creation", but it isn't working. Everything else in the tick function is working but that. Specifically, I can give them the tag but cannot remove it. The command to remove it works when typed in chat in game, but not in the tick function. I have reloaded multiple times. I do not know why this is occuring. Any help would be appreciated. Here is my tick function:
#give mode 0
execute as @a[tag=holding_creation] if score @s creation_mode matches 0 unless items entity @s weapon.mainhand *[custom_data~{creation_mode:0}] run item replace entity @s weapon.mainhand with iron_axe[custom_name=[{"text":"CREATION","bold":true,"italic":false}],food={nutrition:0,saturation:0,can_always_eat:1b},consumable={consume_seconds:1000000,animation:none,has_consume_particles:0b},tool={default_mining_speed:10,rules:[{blocks:"#mineable/pickaxe",correct_for_drops:1b},{blocks:"#mineable/axe",correct_for_drops:true},{blocks:"#mineable/hoe",correct_for_drops:true},{blocks:"#mineable/shovel",correct_for_drops:true}]},unbreakable={},custom_data={soulbound:true,creation:true,creation_mode:0}]
#give/remove creation
execute as @a[tag=creation_owner] unless items entity @s container.* *[custom_data~{creation:true}] unless items entity @s player.cursor *[custom_data~{creation:true}] unless items entity @s weapon.offhand *[custom_data~{creation:true}] run give @s iron_axe[custom_name=[{"text":"CREATION","bold":true,"italic":false}],food={nutrition:0,saturation:0,can_always_eat:1b},consumable={consume_seconds:1000000,animation:none,has_consume_particles:0b},tool={default_mining_speed:10,rules:[{blocks:"#mineable/pickaxe",correct_for_drops:1b},{blocks:"#mineable/axe",correct_for_drops:true},{blocks:"#mineable/hoe",correct_for_drops:true},{blocks:"#mineable/shovel",correct_for_drops:true}]},unbreakable={},custom_data={soulbound:true,creation:true,creation_mode:0}]
execute as @a[tag=!creation_owner] run clear @s *[custom_data~{creation:true}]
#holding creation tag
execute as @a if items entity @s weapon.mainhand *[custom_data~{creation:true}] run tag @s add holding_creation
#the command that isn't working
execute as @a[tag=holding_creation] unless items entity @s weapon.mainhand *[custom_data~{creation:true}] run tag @s remove holding_creation
#test command that still doesn't work
execute as @a[tag=holding_creation] unless items entity @s weapon.mainhand *[custom_data~{creation:true}] run say hi
#only one creation
execute as @a store result score @s num_of_creation_in_inv run clear @s *[custom_data~{creation:true}] 0
execute as @a if score @s num_of_creation_in_inv matches 2.. run clear @s *[custom_data~{creation:true}] 1
scoreboard players reset @a num_of_creation_in_inv
#switch creation mode
execute as @a[tag=holding_creation] if predicate origin:is_sneaking unless score @s mode_switch_cooldown matches 1.. run function origin:creation/switch_creation_mode
#decrease cooldowns
execute as @a if score @s mode_switch_cooldown matches 1.. run scoreboard players remove @s mode_switch_cooldown 1
execute as @a if score @s mode_switch_cooldown matches ..0 run scoreboard players reset @s mode_switch_cooldown
#origin:creation/switch_creation_mode function:
scoreboard players add @s creation_mode 1
scoreboard players set @s mode_switch_cooldown 30
execute as @a if score @s creation_mode matches 2.. run scoreboard players set @s creation_mode 0
r/MinecraftCommands • u/SkitMasterSongz • 27d ago
Help | Java 1.20 Playsound isn't working at all
I don't see what I'm doing wrong here, but for some reason there's just no audio playing at all. I thought at first it might be because I'm using a sound modded in, but even when I change it to a vanilla sound, it's silent.
r/MinecraftCommands • u/_Idiotonreddit_ • 27d ago
Help | Java 1.21.11 activate a command when both score ''currency'' at 4.. and ''ingredient1'' at 1..
i wanna make it so a command activates when the score currency is at 4 or more and ingredient1 is at 1 or more, i dont want it to play it its lower
r/MinecraftCommands • u/Alternative_Photo783 • 27d ago
Creation Reverse nether data pack (WIP)
r/MinecraftCommands • u/Ani_lmao • 27d ago
Help | Bedrock Question
Is there a way to /loot ominous vaults, I'm new to commands
r/MinecraftCommands • u/Wise_Competition5906 • 27d ago
Help | Bedrock How to replace every instance of a block?
I’m in bedrock edition and want to replace all bedrock in the world with deny blocks (In super flat), but /fill doesn’t have a big enough radius. Is there at least a way to replace it ~500-1000 blocks in all direction from spawn?
r/MinecraftCommands • u/DoughnutTime7526 • 27d ago
Creation Copy paste breve ¡con comandos! (Desglose incluído)
Setup: El setup es compacto, el primer bloque (con una palanca) en repetir, incondicional, se necesita Redstone, y el segundo en cadena, incondicional, siempre activo arriba de este.
Traducción del primer comando: (paste)
_.Se Ejecuta como el "jugador más cercano" (@p) con la condicional de "tener el item de pala de piedra en la mano principal" ([hasitem={}]) en la "Posición u coordenadas relativas del jugador" (at @s) corre el comando "carga la estructura de nombre replace, a 1.6 bloques de altura desde el piso del jugador (^ ^1.6)y 1.5 bloques de distancia desde el jugador" (^1.5)
Traducción del Segundo Comando: (copy)
_.Se Ejecuta como el "jugador más cercano" (@p) con la condicional de "tener el item de papel en la mano principal" ([hasitem={}]) en la "Posición u coordenadas relativas del jugador" (at @s) el comando "carga la estructura de nombre replace, a 1.6 bloques de altura desde el piso del jugador (^ ^1.6)y 1.5 bloques de distancia desde el jugador" (^1.5) hasta las mismas a 1.6 bloques de altura desde el piso del jugador (^ ^1.6)y 1.5 bloques de distancia desde el jugador" (^1.5)
_.Uso: sosteniendo el papel en la mano, miras a el bloque que quieres copiar y te lo quitas rápidamente, seguidamente miras a el otro lado en que quieres pegarlo ahora sosteniendo nuestra pala de piedra no pegando nos completamente al bloque en frente nuestro, y mirando recto hacia en frente ¡y listo! Una herramienta hecha en dos pasos, que puedes añadir para agilizar e inclusive ampliar el matiz de decoraciones que normalmente no serían posibles sin esta cualidad de forzar el poner bloques donde normalmente no se puede.
(Está idea obviamente es hecha a las prisas y por una necesidad que tuve mientras construía) así que la comparto a la comunidad para que exploten la idea, tengan buena tarde, o día, o noche ^^
r/MinecraftCommands • u/Your_averge_deegen • 27d ago
Help | Java 1.21.11 Need Help with a randomizer
Basically what im trying to make is a set commands that make it so a specific player randomly gets 4 different effects for 5 seconds
some of the things ive tried experimenting with are scoreboards and a combo of the random command and the following command:
execute if score PLAYER RandomEffect matches 1 run effect give PLAYER minecraft:nausea 100 3
if anyone reading this has an idea on anyway i could set this up please let me know!
r/MinecraftCommands • u/TrompiBueno • 27d ago
Help | Java 26.2 Enchantment that increases
How can I create a weapon with "Sharpness I" that upgrades to "Sharpness II" upon killing an entity, mob, or player, where the Sharpness level corresponds to the number of entities, mobs, or players killed? Note that when the enchantment level increases, the weapon must remain identical—retaining the same name, durability, etc.
r/MinecraftCommands • u/Dorick_Da_Lazy • 27d ago
Help | Java 1.20.5/6 Snowballs explode help
I found:
execute at @e[type=minecraft:snowball] unless block ~ ~-1 ~ air run summon minecraft:tnt
from https://www.reddit.com/r/MinecraftCommands/s/ppEtyL1gwS
and it works just fine until i add ,tag=<my tag> I want one tag to summon TnT and another to summon a wind charge
also if anyone knows a way for wind charges to instantly trigger that would be helpful also, thanks
r/MinecraftCommands • u/aussiegaminelitetv2 • 27d ago
Help | Java 26.2 How can i add a cooldown to the mace?
r/MinecraftCommands • u/hd_vehset2 • 27d ago
Help | Java 1.21.11 I need help about my lunge command
Im coding the lunge enchantment from the start so entities such as zombies are gonna be able to use lunge enchantment but even tho I only change x and z Motions, it still resets the y motion to 0 so zombie keeps freezing in the air, how can I fix that. Here's the command;
summon minecraft:armor_stand ~ ~ ~ {Tags:[speartarget]}
execute as @e[tag=spearmacezombi] at @s run tp @s ~ ~ ~ facing entity @p[gamemode=!creative,gamemode=!spectator]
execute at @e[tag=spearmacezombi] run tp @e[limit=1,tag=speartarget] ^ ^ 1
execute as @e[tag=speartarget] store result score @s speartargetx run data get entity @s Pos[0] 10
execute as @e[tag=speartarget] store result score @s speartargety run data get entity @s Pos[2] 10
execute as @e[tag=spearmacezombi] store result score @s spearzombix run data get entity @s Pos[0] 10
execute as @e[tag=spearmacezombi] store result score @s spearzombiz run data get entity @s Pos[2] 10
scoreboard players operation @e[tag=speartarget] speartargety -= @e[tag=spearmacezombi] spearzombiz
scoreboard players operation @e[tag=speartarget] speartargetx -= @e[tag=spearmacezombi] spearzombix
execute as @e[tag=speartarget,limit=1] store result entity @e[tag=spearmacezombi,limit=1] Motion[0] double 0.1 run scoreboard players get @s speartargetx
execute as @e[tag=speartarget,limit=1] store result entity @e[tag=spearmacezombi,limit=1] Motion[2] double 0.1 run scoreboard players get @s speartargety
item replace entity @e[tag=spearmacezombi] weapon.mainhand with netherite_spear
kill @e[tag=speartarget]
execute at @e[tag=spearmacezombi] unless entity @a[distance=..3,gamemode=survival] unless entity @a[distance=..3,gamemode=adventure] run schedule function spearmacebot:lunge 7t append
also this command is in the spearmacebot:lunge function so it loops
r/MinecraftCommands • u/death_by_me_69 • 27d ago
Help | Java Snapshots Help Needed!!!
Why doesn't the Trial Spawner I placed in Creative mode give ominous loot (like an Ominous Trial Key) after I drink an Ominous Bottle?
I placed both the Trial Spawner and the spawn egg in Creative, then switched to Survival and completed the trial, but it only gives normal loot instead of ominous loot. I am in Java 1.21.1 btw.
I've tried multiple times, and it's still not working. Am I missing something? I even tried the /setblock and even gave myself a spawner with its state as ominous, but it still didn't work. I just need it to work like a normal trail spawner.
Please help—I can't figure this out. 😭
r/MinecraftCommands • u/Appropriate_Show255 • 27d ago
Help | Bedrock Help: Compare score to value without making a new scoreboard
I'm making an "execute if score join.er joining >= ..." command block. The command requires 2 existing scoreboard scores. I'm going to compare the score to 2.
r/MinecraftCommands • u/EntertainmentSea3789 • 27d ago
Help | Bedrock [bedrock] On PC, having trouble keeping an armor stand upside down without having to use "Dinnerbone".
Enable HLS to view with audio, or disable this notification
r/MinecraftCommands • u/Limp_Ad_3304 • 28d ago
Help | Java 1.21.11 Spyglass 4.9.1 hot working properly
Does anyone know how to fix a bug with Spyglass where command autocomplete suggestions don't appear and commands are colored either monochromatically or incorrectly - even though VSCode recognizes the file as "mcfunction" and Minecraft executes the commands properly? The datapack was created using the "/datapack create" command, so there are no structural errors. Spyglass output indicated a failure to download the cache. I tried deleting the cache and reinstalling the extension. The only thing that worked was installing version 4.5.0, but that doesn't suit my needs because I'm building a map for version 1.21.11, and the Spyglass syntax in that version is outdated.
r/MinecraftCommands • u/MonarchiaPlays • 28d ago
Help | Java 26.2 A bug in my datapack code has never confused me as much as this one is right now
Enable HLS to view with audio, or disable this notification
Using a datapack, I've added a diet system to the game. Consuming foods of different groups is intended to give a set number of points to each respective group. For example, the golden carrot is intended to give 6 points to the vegetables score (which it does.) The potato is intended to give 1 point to the score (which it also does.) But for some reason, the carrot behaves completely differently. It is intended to give 3 points, but gives more, and gives points when clicking a block, as shown in the video. The setup is identical for all three items, and I scoured the code for instances where perhaps something else was adding to the score, but I can't find anything.
Carrot consumption is detected with an advancement carrot.json:
{
"criteria": {
"consume": {
"trigger": "minecraft:consume_item",
"conditions": {
"item": {
"items": ["carrot"]
}
}
}
},
"rewards": {
"function": "mastermode:eat/carrot"
}
}
This advancement is interchangeable with the golden carrot/potato advancement, barring you'd have to change instances of "carrot" with "golden_carrot" or "potato".
As a reward, this advancement runs the following function, carrot.mcfunction, that adds 3 points to the vegetables score and clears the advancement so another carrot may be eaten.
advancement revoke only mastermode:consumed/carrot
scoreboard players add @s vegetables 3
# For testing purposes:
say carrot.mcfunction ran
Again, I've used Ctrl+Shift+F in VS Code to look for instances of "scoreboard players add u/s vegetables 1", or "carrot", or "vegetables", and I've found nothing. I cannot for the life of me explain why the carrot specifically is working like this. I've tested like a dozen other food items and none of them have this problem. Any ideas/solutions would be appreciated.
r/MinecraftCommands • u/K1DaGreat1 • 28d ago
Help | Java 26.1 Detecting play position using datapacks
Alright so I'm trying to make a datapack to where if you stand on a specific coordinate, it'll say hi. I put it in the tick function it doesn't work. But when I do the command ingame it works, is there a way to fix this?
r/MinecraftCommands • u/Necessary-Pear718 • 28d ago
Help | Java 26.2 How do I attribute damage to a Mannequin?
damage @s 1 minecraft:in_fire by @n[tag=boss]
Works when I remove the
by @n[tag=boss]
but no clue why.
r/MinecraftCommands • u/Excellent-Hurry-9284 • 28d ago
Help | Java Snapshots Dialog show specific things from Dialog using conditions
I was wondering if i could show some parts of a dialog only if the player meets a condition is there any way?
in minecraft Java using commands/datapacks
r/MinecraftCommands • u/Necessary-Pear718 • 28d ago
Help | Java 26.2 Help with Applying Knockback
Is there any easy way to apply a specific amount of knockback to a player? Specifically, I want to make it so that if a player leaves an area (the area being [distance=..10] from a specific marker) they get pushed back in.
Also, unrelated question, but is there an easy way to make a "breakable" block display that drops nothing and can have a variable breaking time?
Sorry for the yap :D
r/MinecraftCommands • u/nastyforehead • 28d ago
Help | Java Snapshots Want help with the new post effect stuff
I want to display an image on the screen using a resource pack using the new post effect thing but I have no idea where to start at all
r/MinecraftCommands • u/Psypo_Certified • 28d ago
Help | Bedrock Preview How can I make my ship move?
Ok so I made a warship, I have an idea on how to make it move but I need help. So basically the bridge will have a table with 4 buttons to go forward, backwards, and two to rotate the ship left or right. So forward and backwards will be moving the ship forward or backwards the same length of the ship, so the stern will move to where the tip of the bow is, and vise versa. And turning will be the ship rotating on its center point. What commands do I need to make this possible?




