Topic category: Help with Minecraft modding (Java Edition)
Several questions!
I'm playing with a test creature and am trying to move it around.
I created a new LivingEntity in a test workspace and named it PathingTester.
Using the code below, the creature flickers constantly back and forth - it is very stuttery when I expected smooth motion.
1. How can I smooth the creature's motion? The flickering is awful haha
2. What is the proper use of setDeltaMotion? (Nothing happens when I try to use it with this creature.)
3. Are there any weird gotchas or gimmicks I need to keep in mind when choosing a base mob type? (I chose a silverfish for this test)
4. I locked the code for the creature in PathingTesterEntity.java, but not in PathingTesterRenderer.java, and I had to re-lock and re-unlock the whole mod element to change the model from silverfish to slime. Is it intended that all of the java files get locked instead of just the one being edited?
Thanks in advance for help and guidance
@Override
public void baseTick()
{
super.baseTick();
++myTicks;
double radius = 5.0;
//current location
Vec3 pos = position();
double px = pos.x;
double py = pos.y;
double pz = pos.z;
//desired location - circle <0,70,0> over the course of 8 seconds with a radius of 5 blocks
double x = Math.cos(myTicks * (0.05 * Math.PI * 2) / 8.0) * radius;
double y = 70.0;
double z = Math.sin(myTicks * (0.05 * Math.PI * 2) / 8.0) * radius;
//dirty teleport
moveTo(x,y,z);
}
fairly certain moveTo just teleports it. delta motion is already available as a procedure, attempt to override motion vector.
I unlocked the mob's code, then checked the box to enable AI.
Now setDeltaMotion is working as expected.