I'm not at my computer but check for me if there is a entity damage event? Or entity destroy event? Cause if there is you could try cancelling the damage?
Listen for EntityDamageEvent. If the entity is instanceof Item, and the DamageCause is LAVA. Then cancel the event.
The events all worked I tested with debugging but e.setCancled didnt stop the item from burning. Any other solutions
Cast the entity of the event to an Item, and drop that Item's ItemStack wherever you want the item to go. I'm not entirely sure what you're trying to achieve - do you want the item to just sit on top of the lava rather than being destroyed by it? Because if you can't cancel the event, you'll have have to keep respawning the item until a player (somehow) picks it up.
Doing this is more complex than using event.setCancelled(). Minecraft won't stop destroying items that fall in lava. In order to make this work you should create a new Field for exemple Field isInvulnerableItem; And also take into account that you only want items not to be burned when there's an explosion event involved. Use also ItemSpawnEvent to spawn again the items that were protected from invulnerability.
C-can't we just make the Item entity invulnerable? Isn't that a thing anymore? I used to do this back when I played with just commandblocks, but I admit I've never tried with Spigot.
Yes, that works. Though I think it may not work with lava.. not sure. I do both- on item spawn, set the Item entity to invulnerable, but also catch damage events and cancel them. Seems to work for me.