Low friction without ice blocks nor vehicles

Discussion in 'Spigot Plugin Development' started by BadBoy6767, Jan 21, 2018.

  1. I've been looking for a method that maybe the affects of friction on an entity.
    The only solutions I've found are using minecarts and Minecart::setDerailedVelocityMod(Vector).
    Ice blocks are not a good idea since they won't fit with the map and are used somewhere else, so resource packs isn't a solution.
    Minecarts would cause a "sitting" animation, which also isn't good.
     
  2. Hmmm, well... I guess a repeating task that checks BlockFace.DOWN and, if it exists, makes sure that their gravity is off and that their feet are at a specified height, probably .1 more than the block or something (gravity is off, so I guess whatever y distance doesn't cause feet to drag). From there, I suppose you could invent your custom friction mod...
    It'd be horrible if you wanted them to have a say in their velocity aside from direction, though, and you must make sure that you reset their gravity to true after all of what you're doing.
    Not to mention you'd have to manage if there wasn't a block under them and do a while loop to find the lowest nearest block, determine if the 'fall' would kill them.
     
    #2 Drkmaster83, Jan 21, 2018
    Last edited: Jan 21, 2018
    • Like Like x 1
  3. That sounds pretty complicated, but there doesn't seem to be a better way.
    Can you point me in some direction to start making the friction mod?
     
  4. Well I mean... Hm. I just remembered I contributed to this fellow a while back, and we developed a simple velocity system using the velocity mod, but I reckon the same applies here. He has the source on the page.
    https://www.spigotmc.org/resources/rocket-propelled-minecarts.37472/
    Again, though, you can't accept keyboard input for their direction, and the most important part is knowing when to set their gravity back, the two situations being when their velocity bottoms out at a threshold you define (see source of above), or if they... want it to? I dunno. You have to code that. XD Come back to the forums if you've figured out your situations, I guess.