projectile weapon

Started by EzraTube on

Topic category: Help with modding (Java Edition)

Last seen on 20:20, 8. Jun 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
projectile weapon

i'm making a mod with new weapons and stuff and i wanted to know how i can make a projectile weapon that basically has infinity built onto it so you can shoot without anything in your inventory

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This used to be a built in…
Thu, 01/25/2024 - 13:04

This used to be a built in thing, but now you've gotta do it manually. There is technically a way to do this by manually altering the code, but it's kind of complicated, and there's a better way to do it. 

Just make a normal item instead of a ranged item. Then make a procedure that fires a projectile from the target entity, and have it be triggered using the 'item swung' trigger. You can use item cooldown if you want to add a slight delay, or, (if you want to get really fancy), NBT number tags to keep track of ammunition without using items from the inventory.

You will probably also want to damage the item whenever it's fired, if you want it to behave like a regular bow.