This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
tutorial:projectiles [2020/11/16 21:55] spxctreofficial fixing code |
tutorial:projectiles [2020/11/16 22:05] spxctreofficial fixing my idiotic mistakes |
||
---|---|---|---|
Line 202: | Line 202: | ||
*/ | */ | ||
if (!world.isClient) { | if (!world.isClient) { | ||
- | SnowballEntity snowballEntity = new SnowballEntity(world, user); | + | PackedSnowballEntity snowballEntity = new PackedSnowballEntity(world, user); |
snowballEntity.setItem(itemStack); | snowballEntity.setItem(itemStack); | ||
snowballEntity.setProperties(user, user.pitch, user.yaw, 0.0F, 1.5F, 0F); | snowballEntity.setProperties(user, user.pitch, user.yaw, 0.0F, 1.5F, 0F); | ||
Line 217: | Line 217: | ||
} | } | ||
</code> | </code> | ||
+ | Make sure that the projectile that you are launching with this item is indeed your custom ''ProjectileEntity''. Verify this by checking ''PackedSnowballEntity snowballEntity = new PackedSnowballEntity(world, user);''. | ||
+ | \\ | ||
Now, we are finished with creating an item for the ''ProjectileEntity''. Keep in mind that if you do not understand how to create an item, refer to the [[https://fabricmc.net/wiki/tutorial:items|"Item" tutorial]]. | Now, we are finished with creating an item for the ''ProjectileEntity''. Keep in mind that if you do not understand how to create an item, refer to the [[https://fabricmc.net/wiki/tutorial:items|"Item" tutorial]]. | ||
\\ | \\ |