Storing/saving an item in a hashmap

Discussion in 'Spigot Plugin Development' started by TimeVisualSales, May 26, 2015.

  1. Hi there, is it possible to store the players item in hand in a hashmap if so, how would I do this?
  2. HashMap<UUID, ItemStack> items = new HashMap<>();

    Player p = yourplayer;

    items.put(p.getUniqueId(), p.getItemInHand());

    ItemStack inHand = items.get(p.getUniqueId());
  3. Ow, I just realised I had that as well xD Thanks anyway.