Requesting/ Looking for an inventory clear plugin

Discussion in 'Archived: Plugin Requests' started by failtolawl, Nov 19, 2012.

  1. Offline

    failtolawl

    Plugin category: RP/ PVP

    Suggested name: InvDelete
    I am looking for a plugin that deletes on hand inventory/armor/and experience when the player disconnects from the server.


    When I'd like it by: ASAP
     
  2. Offline

    drtshock

    Have it to you in a few. Do you want a bypass permission?
     
  3. Offline

    failtolawl

    Yes that is fine, thanks for this btw.
     
  4. Offline

    drtshock

  5. Offline

    failtolawl

    I love you.
     
  6. Offline

    break2471

    Its called essentials... /ci
     
  7. Offline

    failtolawl

    Please read the post again. I don't want to type /ci everytime somebody leaves.

    and it has been made already.
     
  8. Offline

    drtshock

    Just used the PlayerQuitEvent. Took about 2 minutes to write.

    Code:
    @EventHandler
        public void onLogout(PlayerQuitEvent event)
        {
            Player player = event.getPlayer();
            Inventory inv = player.getInventory();
            inv.clear();
            player.getInventory().setBoots(null);
            player.getInventory().setHelmet(null);
            player.getInventory().setLeggings(null);
            player.getInventory().setChestplate(null);
           
            player.setTotalExperience(0);
            player.setLevel(0);
            player.setExp(0);
        }
     
  9. Offline

    failtolawl

    ok, can you have it so you don't lose your items if you don't manually disconnect?
    like, if it's end of stream, you don't lose your items?
     
  10. Offline

    drtshock

    So if you get kicked or disconnected because your internet goes out or something?
     

Share This Page