Prevent items from being burned

Discussion in 'Spigot Plugin Help' started by dejakob, Jun 2, 2017.

  1. Hello,
    I own a server where fire magic is common but they keep accidentally burn their loot. How can disable this? Im willing to pay a little money on a good plugin if it doenst excist. Thanks
     
  2. Prevent all items?

    If so, let me know and i can make a small plugin (don't want anything for it, just really bored)
     
  3. Yes all items on the floor :) Thank you!
     
    • Agree Agree x 1
  4. Items should not be destroyed only by fire or also by lava?
     
  5. What is your version of the server?
     
  6. Thank you!! It works but it's a bit tricky. Items disappear when burned but you can still pick them up. Is that easy to fix?
     
  7. You can't do that using the API 100%. Not sure if can do that with packets or is clientside
     
  8. I know the Magic plugin by NathanWolf has the option to make items fire protected but I don't know anything about plugin development so I can't help here. :/
     
  9. I asked NathanWolf how to prevent items from burning:

    1. Wands are prevented from despawning using the ItemDespawnEvent
    2. Wand Item entities are set as invulnerable when they are spawned in the ItemSpawnEvent (this is probably the thing you need)
    3. Damage to wand Item entities is cancelled in the EntityDamageEvent (this is what your plugin currently does)

    So you could ask your dev if they'd be willing to add #2 - should just look something like this:

    Code (Text):


    Code (Text):
        @EventHandler(priority=EventPriority.LOWEST)
        public void onItemSpawn(ItemSpawnEvent event)
        {
            event.getEntity().setInvulnerable(true);
        }
    Could you try this for me? I'd do it myself if I knew how to add the lines :)