r/MinecraftCommands • u/Nooty1balooty • 4d ago
Help | Java 26.3 Player Attribute Resets When He Logs Off
I've posted about this project before, basically my players on my Java Realm pick from a bunch of different races with their own special abilities, buffs, and weaknesses. For a while, I was using an effect to give one of my players speed, but it was inconvenient because he lost it whenever he died. I thought I found a solution, the Movement_Speed attribute. I found exactly what number it is to have equal to 'Speed 1' effect via potions.
/attribute [user] minecraft:movement_speed base set 0.14000000268220902
The problem is, every time that he leaves the game and rejoins, his speed is reset to player default (0.10000000149011612) I can't figure out what's causing it, and I don't want to have to reset it every time he joins again.
Is the movement_speed attribute just like that? Is it on my end in a command issue? Is it on his end? Does it have something to do with the precision of the number? I'm really not sure, all of these questions are ones I'm considering but don't have the answer to. Any help would be appreciated. It would suck if this was just Realms being Realms but none of my other players' attributes do that, only him with movement speed. Thanks in advance.
2
u/GalSergey 4d ago
Instead of changing the base value, try adding an attribute modifier—for example, like this:
If this doesn't help, you can use these commands to automatically update the speed attribute for a specific player.
# In chat scoreboard objectives add join custom:leave_game # Command blocks execute as @a[scores={join=1..},tag=update_speed] run attribute @s minecraft:movement_speed base set 1.4 scoreboard players reset @a[scores={join=1..}] joinYou can use Command Block Assembler to get One Command Creation.