r/MinecraftCommands 12h ago

Creation Working clock tower

Enable HLS to view with audio, or disable this notification

161 Upvotes

I made a working clock tower for my server only using commandblocks and a single plugin that lets me create variables but I think it could be easily replaced with a datapack


r/MinecraftCommands 19h 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

25 Upvotes

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 4h ago

Creation I made a particle renderer website :D

Post image
14 Upvotes

You can view particles with their proper sprites, animations, physics, and interactions :))

It also supports having multiple particles active at once, and has support for almost every particle

(This is NOT bug free, So if you encounter any issues please let me know)

https://lukejw12.github.io
This is the website


r/MinecraftCommands 19h ago

Help | Java 26.1 Detecting play position using datapacks

Post image
12 Upvotes

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 11h 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

3 Upvotes

r/MinecraftCommands 1h ago

Help | Bedrock Preview Copy paste breve ¡con comandos! (Desglose incluído)

Thumbnail
gallery
Upvotes

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 4h ago

Help | Java 1.20.5/6 Snowballs explode help

2 Upvotes

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 1h ago

Help | Java 26.2 checking if player is holding items not working only in datapack function

Upvotes

Hello. I am trying to make a tag called "holding_creation" appear only when I am holding an item with the custom_data {creation:true}. It is not working. When I stop holding the item the tag doesn't go away, yet when I run the command that is supposed to remove the tag manually in my chat it works perfectly. For some reason the command does not work exclusively in the tick function. Every other command works in this function. That one just refuses to operate. Can someone explain to me why this is happening? Thank you. Here are all the commands in my tick function:

#give mode 0
execute as [tag=holding_creation] if score  creation_mode matches 0 unless items entity  weapon.mainhand *[custom_data~{creation_mode:0}] run item replace entity  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 [tag=creation_owner] unless items entity  container.* *[custom_data~{creation:true}] unless items entity  player.cursor *[custom_data~{creation:true}] unless items entity  weapon.offhand *[custom_data~{creation:true}] run give  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 [tag=!creation_owner] run clear  *[custom_data~{creation:true}]


#holding creation tag
execute as  if items entity  weapon.mainhand *[custom_data~{creation:true}] run tag  add holding_creation
execute as [tag=holding_creation] unless items entity  weapon.mainhand *[custom_data~{creation:true}] run tag  remove holding_creation
execute as [tag=holding_creation] unless items entity  weapon.mainhand *[custom_data~{creation:true}] run say hi


#only one creation
execute as  store result score  num_of_creation_in_inv run clear  *[custom_data~{creation:true}] 0
execute as  if score  num_of_creation_in_inv matches 2.. run clear  *[custom_data~{creation:true}] 1
scoreboard players reset  num_of_creation_in_inv


#switch creation mode
execute as [tag=holding_creation] if predicate origin:is_sneaking unless score  mode_switch_cooldown matches 1.. run function origin:creation/switch_creation_mode


#decrease cooldowns
execute as  if score  mode_switch_cooldown matches 1.. run scoreboard players remove  mode_switch_cooldown 1
execute as  if score u/s mode_switch_cooldown matches ..0 run scoreboard players reset u/s mode_switch_cooldown

r/MinecraftCommands 2h ago

Help | Java 1.21.11 Need Help with a randomizer

1 Upvotes

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 4h ago

Help | Java 26.2 Enchantment that increases

1 Upvotes

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 5h ago

Help | Java 26.2 How can i add a cooldown to the mace?

Thumbnail
1 Upvotes

r/MinecraftCommands 8h ago

Help | Java 1.21.11 I need help about my lunge command

1 Upvotes

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 9h ago

Help | Java Snapshots Help Needed!!!

1 Upvotes

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 10h ago

Help | Bedrock Help: Compare score to value without making a new scoreboard

1 Upvotes

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 20h ago

Help | Java 26.2 How do I attribute damage to a Mannequin?

1 Upvotes
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 14h ago

Help | Java 1.21.11 Spyglass 4.9.1 hot working properly

0 Upvotes

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.