Posted February 21, 201411 yr How can i add movement speed in water without Potion Effect? what code should i enter ?
February 21, 201411 yr This probably isn't the most efficient way (plz dont yell at me draco/ben/someone): //Put this in a ticker if(player.isWet()) { //Set to your speed } else { //Set to default speed } Kain
February 22, 201411 yr player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(blah); Kain
February 22, 201411 yr If you use an attribute modifier, you will have to be sure to remove it once the player is out of the water. A much simpler method is to just multiply the player's current motion by a factor: float f = whatever value you want, maybe 2.0F; player.motionX *= f; player.motionZ *= f; You can multiply the Y motion as well, but generally x and z are what you want. http://i.imgur.com/NdrFdld.png[/img]
February 22, 201411 yr Author It not work .... if(player.getCurrentItemOrArmor(1) != null){ ItemStack boots = player.getCurrentItemOrArmor(1); if(boots.getItem() == Basic.Flippers){ if(player.isInWater()) { float f = 2.0F; player.motionX *= f; player.motionZ *= f; } } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.