Hey spigot, I made a custom enchants plugin that has a laser enchant that shoots an egg and breaks the block, how do I make it so it picks the items instantly and sends it to the player's inv. I also have a drill enchant, which I want the items to automatically send the items to the player's inv aswell. but how do I implement enchants to it. I have tried block.breakNaturally(item); but it seems to now work w/ fortune
As far as I know that does work with fortune. Just pass the tool (with the fortune enchant) as the item. If it doesn't work it's most likely a Spigot bug, because it should work as far as I know.
As I said earlier, I already know the method I just don't know the code eto implement it. if i do player.getInventory().addItem() you can only add one item
You can get the drops from the event and return an array of ItemStacks, then simply add them to the player's inventory.
Make sure you handle the case when a players inventory is full (unless you want pissed off players ).