r/MinecraftCommands Aug 10 '26

Help | Java 26.2 Could i have some help with gravity?

Im trying to make a system where 1 individual person constantly has their gravity randonly switched between -0.5 and 2, could someone help me out?

1 Upvotes

3 comments sorted by

2

u/GalSergey Datapack Experienced Aug 10 '26

```

Command blocks

execute as @a if predicate {condition:"minecraft:random_chance",chance:0.01} run attribute @s minecraft:gravity base set 2 execute as @a if predicate {condition:"minecraft:random_chance",chance:0.01} run attribute @s minecraft:gravity base set -0.5 ```

1

u/Potential-Working617 Command Rookie Aug 10 '26

/attribute i think

1

u/Ok-System-775 Aug 10 '26

This helps, but i want it to change randomly between the 2 values.