getCurrentItem().clone(); not working?

Discussion in 'Spigot Plugin Development' started by kinukin, Jun 9, 2017.

  1. Code (Text):
        @EventHandler
        public void onInventoryClick(InventoryClickEvent e) {
     
                    e.setCancelled(true);
                    e.getCurrentItem().clone();
                    System.out.println(e.getCurrentItem().clone().toString());
        }

    Does this method not work?
     
  2. It does, but maybe not like you are expecting it to work.
    What do you want to achieve?
     
  3. Not sure what you are trying to do but if you want to copy the item do

    ItemStack clone = new ItemStack(e.getItem);
     
  4. Clone does the same thing.
     
  5. No Comment...

    I Didn't Know That
     
    • Like Like x 1