User Tools

Site Tools


tutorial:projectiles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:projectiles [2022/12/21 01:38] – itemgroup for 1.19.3 haykamtutorial:projectiles [2024/03/08 01:56] (current) – [Creating & Registering a Projectile Entity] Update names, add @Override, and change some parameters to match 1.20.4 yarn netuserget
Line 83: Line 83:
  return null; // We will configure this later, once we have created the ProjectileItem.  return null; // We will configure this later, once we have created the ProjectileItem.
  }  }
- @Override+
  
  @Environment(EnvType.CLIENT)  @Environment(EnvType.CLIENT)
Line 103: Line 103:
  }  }
  
 + @Override
  protected void onEntityHit(EntityHitResult entityHitResult) { // called on entity hit.  protected void onEntityHit(EntityHitResult entityHitResult) { // called on entity hit.
  super.onEntityHit(entityHitResult);  super.onEntityHit(entityHitResult);
Line 117: Line 118:
  }  }
  
- protected void onCollision(HitResult hitResult) { // called on collision with a block + @Override 
- super.onCollision(hitResult);+ protected void onBlockCollision(BlockState state) { // called on collision with a block 
 + super.onBlockCollision(state);
  if (!this.world.isClient) { // checks if the world is client  if (!this.world.isClient) { // checks if the world is client
  this.world.sendEntityStatus(this, (byte)3); // particle?  this.world.sendEntityStatus(this, (byte)3); // particle?
tutorial/projectiles.txt · Last modified: 2024/03/08 01:56 by netuserget