Sorry about this question, I think I may have asked before but this website is confusing and I just simply can't find it anywhere. I'm a Java plugin developer who is currently in a Data Structures and Algorithms class, if it helps to know how much I'll understand. I've been on servers where random items can be used as projectiles, things like gold block item entities or watermelon slice item entities. I was wondering if anybody knew how to make an item a projectile? I figure I'll need to create a new object class with the new methods and whatnot, but I'm not sure how this works, especially since I can't alter Minecraft's own code.
All help is greatly appreciated!
You could replace a bow's arrow projectile with your own custom projectile, such as an item entity. You would catch the ProjectileLaunchEvent and do something like this:
If you wanted to deal damage, you would have to constantly track it's location with schedulers, check if it intersects a player, and deal the appropriate amount of damage. Or, if you want a simpler approach, just see if a player picks up the item, take the item out of their hands, and deal damage.