[Tutorial]2024.4 Mario Fireball Code

Started by dkrdjdi on

Topic category: User side tutorials

Joined May 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Tutorial]2024.4 Mario Fireball Code
Fri, 12/20/2024 - 10:37 (edited)

https://imgur.com/EzNOO5G

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