Solved Disable drag for NMS zombies in the air

Discussion in 'Spigot Plugin Development' started by domisum, May 27, 2016.

  1. Hello Spigot-community,

    I created a custom NMS zombie that has some additional abilities, one of which includes a high jump to a specific location. Everything works, only the drag of the entity is a problem: The calculated jump direction and speed are not exact, since drag slows the zombie down in mid flight. How can I disable the drag for a nms zombie in the air? I can just override nms methods, I just need a pointer to where to look.

    I went through the decompiled classes "EntityLiving" and "Entity", but the only method I found was #g(float, float) in the class EntityLiving, which start on line 1509 and ends on line 1681. There the motX, motY and motZ variables are multiplied with something that could simulate drag. Am I on the right track? Which multiplications do I have to remove to disable drag?
  2. I fixed the problem indireclty by setting the speed in the x- and z-direction every tick to the wanted value. This does not really adress the problem, but the solution worked for me and may for someone else in the future.