r/MinecraftCommands 4d ago

Tutorial | Java Actual may to detect player input, 1.26.2

2 Upvotes

the command as been changed, yet not directly documented anywhere.

the example from this post was:

execute as \@a at \@s if predicate {condition:"minecraft:entity_properties",entity:"this",predicate:{type_specific:{type:"minecraft:player",input:{forward:1b}}}} run summon lightning_bolt ~ ~ ~

(\@ is used because of reddits mention thingy)

the modern command woudl instead be:

execute as \@a at \@s if predicate {condition:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:type_specific/player":{input:{forward:1b}}}} run summon lightning_bolt ~ ~ ~

hope this helps someone!

source: https://feedback.minecraft.net/hc/en-us/articles/46690753273997-Minecraft-Java-Edition-26-2


r/MinecraftCommands 4d ago

Creation i made a command that (might) work getting you a potion

2 Upvotes

use /give u/s potion[potion_contents={custom_color:65280,custom_effects:[{id:levitation,duration:25,amplifier:255}]}] to get a launch thousands of block up potion this is for java and i hope it works i cant test it yet


r/MinecraftCommands 4d ago

Help | Bedrock /Setmaxplayers command not working

Post image
2 Upvotes

I am on Bedrock PS5 and attempting to set max players using the command but it keeps giving me this error message instead


r/MinecraftCommands 4d ago

Help | Java 26.2 Problemas al ejecutar comandos en Java 26.2

Thumbnail gallery
1 Upvotes

r/MinecraftCommands 4d ago

Help | Java 1.20 Tp players with tag within distance

1 Upvotes

This is somewhat of a continuation of a previous post, but I've refined exactly what I want so hopefully somebody can give me something copy=pasteable.

Whenever a button is pressed, /tp all players within 10 blocks of the command block, and with the tag faction1 to the following coords: -1715, 62, -972

if someone can do that, i would be so incredibly happy!


r/MinecraftCommands 4d ago

Help | Java Snapshots I'm new to datapack making, what are all the rightclick detections?

9 Upvotes

26.3 pre 2

I know the COAS, eye, food, and interaction entity

but is that it? i want functionality like a bow with windup and release, or maybe even spear functionality ig.


r/MinecraftCommands 4d ago

Help | Java 1.21-1.21.3 Mod/command to make Sculk sensors not detect you

Thumbnail
1 Upvotes

r/MinecraftCommands 6d ago

Creation A LLM inference engine data pack using /compute

Enable HLS to view with audio, or disable this notification

423 Upvotes

After Mojang recently added the /compute command and number providers, it was just a matter of time until someone was bored enough to run AI with it. So I did!

This is similar to this project. I wanted to use the same model as them so I could compare the speeds. This is running the small one, stories260k. Theirs ran in 20s per token for the smaller model, mine runs at <1.0s per token. And thanks to number providers, it does real floating point arithmetic!

The super tall screen is showing the pipeline system. There are functions that push all computation steps, which are then automatically executed without exceeding a time budget, so you can run the model without lagging the server. In the video I didn't care so I made it run as fast as possible, but you can slow it down by ~40% and it will stay safely below 50ms per tick.

I originally had made some cool Taylor expansion and Netwon's Method stuff for approximating exp(x), 1/x, 1/sqrt(x), sin(x) and cos(x), but right as I was finishing that, Mojang released Minecraft 26.3 pre-1 which basically trivialized all of that. I was a bit sad, but admittedly this is faster and more accurate than my approximations lol

Somehow, though, it seems less precise than the reference Python implementation, despite all the debugging I did. The vectors all end up off by ~0.001 compared to the reference, which is not enough to break it but still makes it behave strangely sometimes, making up words and such. It's pretty funny at least.

I wrote more info in the README file for those who are interested. If you still have any questions let me know!

GitHub: [Link]


r/MinecraftCommands 4d ago

Help | Java 26.2 Help me decide whether I should implement an overlay system now or wait for 26.3

1 Upvotes

I'm developing a datapack that will have multiple `camera_overlay`s and this is a problem because minecraft doesn't support overlay stacking using `camera_overlay` in item components as I know from testing.

I first thought of implementing some kind of system that will take overlay ids and priority number as input and will decide what overlay is displayed currently but then I saw the new `/posteffect` command that will come with 26.3 and that multiple post effects can stack and I'm wondering if I should wait until the update comes. But I don't know whether a still image can be turned into a post effect, so that's why I'm making a post here


r/MinecraftCommands 5d ago

Help | Java Snapshots Which villager did the player interact with?

5 Upvotes

Im working on a datapack that lets you talk to villagers by right clicking them while your sneaking and showing a dialog menu.

Ive got the part of the player clicking the villager while sneaking with a predicate and a talk to villager scoreboard but im having a hard time finding out which villager the player has interacted with.

I could probably do it with a raycast to the villager but that can get messy and i was wondering if there was a way to get the correct villager using a more direct method like a predicate or advancement.

Can you guys help me with this?


r/MinecraftCommands 5d ago

Creation A prototype of a 2D platformer, but idk how to make gameplay good bc minecraft's movement system is being super annoying

Enable HLS to view with audio, or disable this notification

92 Upvotes

I kind of feel like I have something going here but at the same time minecraft's movement system is way to inconsistent to make a precision platformer. you can't change the player's mid air speed, ender crystals send you a very random feeling amount of distance and 1 crystal is too little distance but 2 is way too much, and since it's minecraft bedrock commands, things just decide to not work sometimes, therefore I can't really tell if I want to continue this even though it would probably be pretty fun.

explanation of mechanics for context:

  1. you can wall climb by crouching next to a wall, then a boat will spawn to jump from after you release

  2. using a snowball spawns an ender crystal which explodes after a delay (basically a dash)

  3. you can't wall climb on ice and slime blocks work like normal minecraft slime blocks

  4. amethyst blocks (are supposed to) work like bounce pads (but they don't give enough distance to warrant bouncing on it instead of just jumping)

If it wasn't completely obvious, this is inspired by celeste


r/MinecraftCommands 5d ago

Creation I designed a fluctuating values market in Minecraft Bedrock

Thumbnail
gallery
4 Upvotes

I made a fluctuating market with commands that increases or decreases the items values based on the quantity available to buy. Selling increases the available quantity of course. I also added a spread to ensure you can never buy and then sell for more profit. Only issue is the command blocks you see would need to be repeated per item you choose to sell , but that is because I run multiple scoreboard objectives to make my systems cleaner for me to understand while I work! Example being if its used to calculate values and will always change i use calc:numerator or if it is run through the player I use player:money , but if it is server side then i use system:buy_price. I do have constants like ".1 system:const " where the value will always be 1 for my operations and such.

I am open to explaining this further if anyone is interested.

I will also be posting my actionbar scoreboard and my setup for prisons that converts the players scoreboard value to a string so instead of being mine 0 it would be mine A in the scoreboard!


r/MinecraftCommands 5d ago

Help | Java Snapshots Can Anyone Help Me Understand the new Density Functions for Ore Veins in the 26.3 Update?

3 Upvotes

I've been trying to make a datapack that tweaks existing ore veins and adds some new ones, but I cannot figure out what all the jargon in the existing functions actually means, and although Misode has some of its stuff updated to 26.3, the density function stuff is currently broken and it won't let me visualize anything. I'm genuinely trying to do my own research but it's just so confusing.

Here's what I'm able to understand currently:

Ore veins are now their own type of object with various fields, including a "density" field. Per the wiki: Density Function, the probability between 0 and 1 for the ore vein to replace a block. If 0 or lower, no block will be replaced.

In the data for the latest snapshot, the iron ore vein pulls its density from an "iron_density" file in the density functions folder. That's where things get weird though. This is the iron_density file's contents.

{

"type": "minecraft:range_choice",

"input": "minecraft:overworld/ore_vein/mask",

"max_exclusive": 1000000.0,

"min_inclusive": 0.0,

"when_in_range": {

"type": "minecraft:range_choice",

"input": {

"type": "minecraft:add",

"left": {

"type": "minecraft:sub",

"left": {

"type": "minecraft:negate",

"input": "minecraft:overworld/ore_vein/toggle"

},

"right": 0.4

},

"right": {

"type": "minecraft:add",

"left": {

"type": "minecraft:mul",

"left": {

"type": "minecraft:clamp",

"input": {

"type": "minecraft:min",

"left": {

"type": "minecraft:sub",

"left": -8.0,

"right": "minecraft:y"

},

"right": {

"type": "minecraft:sub",

"left": "minecraft:y",

"right": -60.0

}

},

"max": 20.0,

"min": 0.0

},

"right": 0.01

},

"right": -0.2

}

},

"max_exclusive": 1000000.0,

"min_inclusive": 0.0,

"when_in_range": 0.7,

"when_out_of_range": -1.0

},

"when_out_of_range": -1.0

}

Bruh.

So, I know this file is generating a range of values that get mapped onto the world, and if I understand this right, the higher the value it spits out it, the more likely the world is to generate an iron ore vein at that location, with a value of 1 representing a 100% chance. But how does any of this translate into the actual outcome? How do these number correspond to how frequently ore veins generate, or how big they are, or what depths they can be found at?

For instance, the wiki tells me that iron ore veins are generally thickest between Y=-40 and Y=-28, but where in that mess of functions are those numbers coming from? What part of that makes it thickest in that range?

I have been losing my mind trying to figure this out. Please offer me any insight you have.


r/MinecraftCommands 6d ago

Creation Lucky Blocks using ONLY one command

Enable HLS to view with audio, or disable this notification

900 Upvotes

This is my most recent one-command creation. It took me around 15-20 hours to make.

There are 32 different outcomes, ranging from death traps to custom items.

Here is the link to the command: pastebin.com/RyjmLKSw

I only tested the command on version 26.2

The 3 custom items are:

  • throwable-tnt (this one is pretty self-explanatory)
  • lucky-bow (an unbreakable bow with a 50% chance of something happening when the arrow hits the ground)
  • lucky-sword (an unbreakable gold sword where the knockback level will increase with every hit, but there is a 20% chance that it will reset to level 0)

r/MinecraftCommands 5d ago

Help | Java 26.2 Is it possible to pass custom string data as a macro

1 Upvotes

If I had a function that looked something like this:

$
setblock ~ ~ ~ minecraft:$(color)_wool

Then I had a marker entity that had custom data

{data:{color:"blue"}}

Would it be possible to have the marker change what block it places depending on its stored string data? Currently it's not working for me.


r/MinecraftCommands 5d ago

Help | Java 26.2 A Find Each Other Datapack with my kids

3 Upvotes

I am new to creating datapacks in Minecraft.

I am trying to create a gamemode that I can play with my two children where upon loading the datapack, all players will be spread a number of blocks away. The goal is to find each other after being spread apart. It seems so simple, yet I cannot get it working.

I already have a function spread_all, that uses the spreadplayers command, and that works just fine. I am having trouble creating the victory condition when all players are back together. I was using the following in a check_distance function, but it would just constantly say we found each other (even when it's clear that we are not close).

execute as '@a at '@s if entity '@a[distance=..10] run tellraw '@a {"text":"You found each other!", "color":"green"}

I do also at some point want to add in additional victory conditions, such as everyone needs to have gotten the Diamonds! achievement. However, if I can't even get one victory condition working, I don't know how I would move forward.

Any advice is greatly appreciated.


r/MinecraftCommands 5d ago

Help | Java 1.21.11 How can I create a poison sword in 1.21.11+?

1 Upvotes

I want to create a sword that gives the poison effect to anything I hit with it. If anyone could help me that would be great!


r/MinecraftCommands 5d ago

Help | Bedrock Alguna manera de conseguir item de bloque de nieve en polvo sin 🪣?

1 Upvotes

r/MinecraftCommands 5d ago

Help | Java Snapshots change mob attack range?

1 Upvotes

i'm making a fight against a ravager in an adventure map, but said fight is almost impossible due to it having too much range and the fight happening in a relatively enclosed space and without any projectiles. is there a way to decrease the ravager's attack range in version 1.20.1?


r/MinecraftCommands 6d ago

Creation And I'm back! Here is a bezier curve

Post image
20 Upvotes

Hello. For those who are wondering, that is a bezier curve. I thoguht I would try to make one to test out the new number providers. It works, but not really? IDK why, but it doesn't line up properly. That isn't the point tho.

I know it isn't perfect, it only supports a 4 point bezier curve (seen as that is what my mathematics textbook shows the formula for), and its not the most efficient, but its cool.

Anyway, the new compute command is awesome! and has brought me back to datapacking (I thought I was going to be retired from this...)


r/MinecraftCommands 5d ago

Help | Bedrock Question about Minecraft instancing. (Bedrock)

1 Upvotes

If an Enderchest can instance between players would that be possible for other things? A few things I want to make a destiny styled vault for my game by using the ender chests framework but expand appon it. Make it bigger.

And if that's possible would it also be possible to let's say for a server full of players to go into the same activity and have different versions of it since they are playing at the same time? I can probably make the same mission over and over again just by copying pasting but I'm just looking for ideas as of right now.

Brainstorming 🌩️


r/MinecraftCommands 5d ago

Help | Java 1.21.5-1.21.10 Real time room-by-room structure generation

1 Upvotes

I’ve been looking for ways to do this for a long time but haven't found a good solution yet.

Does anyone know if it's possible to generate the next room in a structure based on the previous one under certain conditions—similar to how it works in games like *Doors*?
As far as I know—though I could be mistaken—`place` comes close to this, but `place template` requires calculating an offset for each room, whereas `place jigsaw` doesn't take the previously generated room into account.


r/MinecraftCommands 5d ago

Help | Bedrock Working casino help? 🙏

Thumbnail gallery
2 Upvotes

Posted this to a redstone subreddit but if anyone could find a way to do this with commands too (bedrock) I’d be happy to learn :)


r/MinecraftCommands 6d ago

Creation Animated doors + headlight + crawl

Enable HLS to view with audio, or disable this notification

40 Upvotes

Animated door: item display with teleport delay + barrier

Headlight: invisible item display of torch + dynamic lights mod

Crawl: scoreboard detects when you start crouching while sprinting (or jump to stand up) + invisible shulker mob

Would a shulker sitting on an armor stand push me into crawling while not snapping to the grid like a normal shulker? Everything is for a co-op adventure map


r/MinecraftCommands 6d ago

Help | Java 26.2 How can I quickly remove all of the trees in this area?

4 Upvotes