Started by
dkrdjdi
on
Topic category: User side tutorials
This is what it looks like when you apply the code to the projectile.
Step1.
Locate the code in the code editor of the projectile.
@Override
public void tick() {
super.tick();
if (this.inGround)
this.discard();
}
Step2.
Overwrite the code.
@Override
public void tick() {
super.tick();
if (this.inGround) {
Vec3 motion = this.getDeltaMovement();
this.setDeltaMovement(motion.x, -motion.y, motion.z);
this.setPos(this.getX(), this.getY() + 0.1, this.getZ());
this.inGround = false;
}
if (Math.abs(this.getDeltaMovement().length()) < 0.1) {
this.discard();
}
}
Edited by dkrdjdi on Fri, 12/20/2024 - 10:37