r/MinecraftCommands

Minecraft command help

Help please, I need a comment changed from Java edition to bedrock but I refuse to use ai for it and I don't know anything about Minecraft commands so I'm confused. Here's the command

/execute at @e[type=snowball] run fill ~10 ~10 ~10 ~10 ~10 ~10 Minecraft:air

reddit.com
u/PlotTwist-ImNotReal — 21 hours ago
🔥 Hot ▲ 6.6k r/MinecraftCommands+4 crossposts

I made a generative AI, only using 400k command blocks (PoC)

While I am still writing on my physics engine, I thought making an actual generative AI only using Minecraft command blocks would be a good idea( it was a headache)
So yeah, I kinda did that. It is a real neural language model running inside vanilla Minecraft 26.2. It reads what you type into a /dialog window, runs the forward pass through learned weights and then generates a reply one word at a time.
There are NO mods, plugins or datapacks involved at runtime. Only command blocks.
Roughly it works like this:

The model is a pretty small word level neural language model. It has a vocabulary of 2048 words, remembers the last 6 words as context and has a 64 dimensional embedding followed by a hidden layer with 256 neurons.
For every generated word it does:
384 x 256 = 98,304 operations for the hidden layer and 256 x 2048 = 524,288 operations for the output layer so in total 622,592 calculations for every single generated word.

Obviously doing 622k normal multiplications using Minecraft commands would be slightly problematic, so the weights are ternary: every weight is only -1, 0 or +1.
That means a multiplication basically becomes:
+1 -> add the value
-1 -> subtract the value
0 -> do absolutely nothing

Around 65% of the weights are non 0, so it averages around 0.67 commands per MAC instead of the ~3 commands I would need for a normal runtime weight. That reduced the entire machine from 1,909,375 blocks to 445,782 blocks, yes it was this big before.
The model is actually trained like this too. I am not just training a normal model and rounding the weights afterwards. During training the weights are quantised to ternary values for the forward pass and the underlying floating point weights are updated using a straight through estimator.
That took the perplexity from around 48.7 where the training basically got stuck to 38.8 after also adding cosine learning rate decay.

The input embedding is another optimisation I needed to do: Instead of multiplying a one hot vector against a matrix, it is basically just a table lookup stored in NBT data, so the complete 2048 x 64 embedding table costs really nothing
The actual forward pass cannot run in one command chain either. Minecraft has limits on how many commands can execute, so the network is split into smaller groups.
After the ternary optimisation one generated word takes around 63 ticks, so roughly 3.2 seconds per word at 20 TPS. I also tested higher tick rates and around 30-35 TPS seems to be the useful maximum on my server. At 35 it gets closer to ~1.8 seconds per word.

But to be clear, this thing does not actually know anything.
It was trained on 11,118 DailyDialog conversations and only has a tiny 2048 word vocabulary. Ask it something like 2 + 2 and it will confidently generate some conversational nonsense because it has no understanding of arithmetic or actual facts.
And unfortunately just making it much bigger isn't really realistic either.
Something like a 135M parameter language model would already be more than 200x larger.

There is currently also one very weird bug where after around 800 ticks of continuous work every command block in the world just stops executing while the server itself keeps running normally. I still have absolutely no idea why that happens.
Anyway, back to wasting my time on nonsense ;)

u/_objz — 3 days ago

Random fireworks loot table

Is there a simple way to create a loot table of fireworks with random explosion and fade colors, shape, additional effects and flight duration? Or do I really just have to code a bunch of different fireworks manually? I tried to use Misode, but it doesn't seem like these parameters accept something like "any_of" function to pick random values from the list and Wiki tells the same.

reddit.com
u/VasD3 — 1 day ago

Check for rain

Is it possible to check if it's raining, and more specifically if a player is standing in the rain, with command blocks or is that too far out of the realm of possibility for Vanilla commands?

reddit.com
u/Watermellonqwerty — 2 days ago

ITEM THAT DOESNT GET CONFSUMED WHEN EATEN

Can someone help me make a command that makes it so an item dosent get consumed when eaten and always get replenished? (IN VANILLA)

reddit.com
u/_Riceboi — 1 day ago

Removing a specific amount of items in my inventory

Im using /clear @p copper_ingot 32. I have 32 copper ingots in my inventory. And when I try to run the command it says "could not clear inventory of [player], no items to remove". Whats going on

reddit.com
u/PersesAMillion — 2 days ago

text displays

how do i make a text display appear on the same spot on screen no matter where you look? i already tried stuff like /tp @e[type=text_display] ^whatever ^whatever ^whatever but it doesn't stay in the same spot on screen. any ideas? on 26.2 btw

reddit.com
u/Weary_Nebula7194 — 2 days ago

is there a way to detect is a certain player on a team dropped an item?

or if there's anything similar? sounds simple but i havent been able to find anything on it,
tho my current work around is giving everybody on the team a different tag and have different command chains correspond to whatever tag did the task that was asked for

reddit.com
u/makoisreal — 2 days ago

Need help anyone got ideas? (Custom guns command blocks)

I want to make a gun in Minecraft using some sort of click detection crouch based detection is like my last resort? Any ideas look for any possibility I can get.

reddit.com
u/Embarrassed_Tree_413 — 2 days ago

is it possible to detect which player has attacked a sulfur cube most recently?

https://preview.redd.it/vlm1aw6yw5kh1.png?width=1920&format=png&auto=webp&s=f7ecf318bb66eac4661f5aaaf402abb5be347d12

i have a game idea (with a mostly finished build)

basically; players whack sulfur cubes and they gain points depending on which pit it goes into (blue = 1, yellow = 3, green is 5, might make the middle and furthest blue ones score more)

but for multiplayer, i dont really know how to make the score individual instead of global

my theoretical idea is; sulfur cube, when attacked by a player, gets its name or tag set to match the player that most recently attacked it
then each pit has an "every sulfur cube landing in it gives score to the player whose name/tag it has X points" followed by un-tagging the sulfur cube to avoid it giving points multiple times

is this idea even possible?

reddit.com
u/Wypman — 2 days ago

How do I teleport an entity to another dimension when they get close to an entity?

So I'm trying to create a datapack, and one of the features is if you get close to this entity that's in the end, you get teleported back to the overworld.

Here's the current command I have: execute in minecraft:the_end run execute as \@e[type=minecraft:armor_stand,tag=overworld] at \@e if entity \@e[distance=..80] run tp \@p distance=..80] 0 350 0

And yeah ik when you look at it doesn't TP me to the overworld, but hoping someone could please give some guidance on what to add to make it TP. I've been stuck on this for half an hour 😭

And yeah ik I could probably use scoreboards, but but if there is another way instead that doesn't use scoreboards, that would be much appreciated, thank you.

reddit.com
u/TomStarr213 — 2 days ago

Command Block repeat help

Hello, I’m trying to make dancing armor stands. Which I got down, I’m able to loop Redstone with normal command blocks to constantly loop4-5 posses to a specific armor stand. My problem is I want to execute this but only have to rotate the positions 3-4 loops then completely stop untill the button is pressed again. I’m new to command blocks as I just started learning yesterday. So I’m having a hard time figuring this out.

reddit.com
u/NoSandwich2826 — 2 days ago

Made a simple datapack for my kid so leaves drop more apples (and maybe some golden ones)

Was playing a survival world with my kid and he got tired of breaking hundreds of leaves just to get a few apples.

So I put together a quick datapack called Apple Bonanza. Leaves now drop extra apples, with a small chance for golden apples (and a rare surprise spider trap that scared the life out of him the first time it happened lol).

You can tweak the drop rates in-game through chat.

Uploaded it to Modrinth in case anyone wants it for their own world:

https://modrinth.com/datapack/apple-bonanza

Let me know if you run into any bugs!

u/Key_Tip_274 — 3 days ago

Command help /clone

for example i have 2 markers (or any other entity) with tags "Tag1" and "Tag2", i wanna copy build from marker with tag "Tag1" to marker with "Tag2", surely without datapacks. (any place to copy to)

reddit.com
u/AmbitiousSuit5561 — 3 days ago
▲ 52 r/MinecraftCommands+2 crossposts

Smiler Entity

I'm making a datapack that adds the Backrooms, and this is the "Smiler" entity.

To avoid it, you need to crouch-walk; if you run or walk normally near it, it will start chasing you.

u/JustaCake08 — 4 days ago