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
Next revisionBoth sides next revision
tutorial:projectiles [2020/11/16 21:55] – fixing code spxctreofficialtutorial:projectiles [2020/11/16 22:05] – fixing my idiotic mistakes spxctreofficial
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]].
 \\ \\
tutorial/projectiles.txt · Last modified: 2024/03/08 01:56 by netuserget