This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:projectiles [2020/11/16 21:55] spxctreofficial fixing code |
tutorial:projectiles [2020/11/16 22:17] spxctreofficial tutorial-download |
||
---|---|---|---|
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]]. | ||
\\ | \\ | ||
Line 408: | Line 409: | ||
Now, your projectile should be working in-game! Just make sure your textures are in the right place, and your item and projectile should be working. | Now, your projectile should be working in-game! Just make sure your textures are in the right place, and your item and projectile should be working. | ||
+ | |||
+ | If you would like to try out this projectile, download [[https://github.com/spxctreofficial/fabric-projectile-tutorial/releases/download/v1.0.0/projectile-tutorial-1.0.0.jar|here]]. | ||
[INSERT USABLE PICTURE HERE] | [INSERT USABLE PICTURE HERE] |