I tried the usual:
player.capabilities.setPlayerWalkSpeed(speed);
No method for setPlayerWalkSpeed, and it's correct it doesn't have because is a EntityPlayerMP.
There is any way to change speed while being on server side? The topic is kinda scarce.
I tried:
PlayerCapabilities cap = ObfuscationReflectionHelper.getPrivateValue(EntityPlayer.class, player, "capabilities", "field_71075_bZ");
player.capabilities.setPlayerWalkSpeed(speed);
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, cap, speed,"walkSpeed", "field_73357_f");
It works as intended but the private field name changes from version to version and i would like something more maintanable(someone with forge 1.10 and i had 1.12 and the field name was the only problem).
What are my choices?