Solved Can't set anvil output

Discussion in 'Spigot Plugin Development' started by Kepling, Jan 27, 2020.

  1. HI, I'm trying to change the output of an anvil. Can someone explain why this doesn't work? Please, Thank you.

    Code (Text):
    @EventHandler
        public void onInventoryClick(PrepareAnvilEvent event) {
            Bukkit.broadcastMessage("working");
            AnvilInventory anvilInv = event.getInventory();
            anvilInv.setItem(2, new ItemStack(Material.PAPER));
        }
    and sorry in advance for missing something obvious
     
  2. md_5

    Administrator Developer

    Dont use setItem, use event.setResult
     
    • Like Like x 2