tutorial:projectiles
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| tutorial:projectiles [2022/12/21 01:38] – itemgroup for 1.19.3 haykam | tutorial: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, | this.world.sendEntityStatus(this, | ||
tutorial/projectiles.1671586699.txt.gz · Last modified: 2022/12/21 01:38 by haykam