Anti-Craft Help

Discussion in 'Spigot Plugin Help' started by IHyperionI, May 31, 2017.

Thread Status:
Not open for further replies.
  1. Im still getting the hang of spigot and i ran into a problem that i cant seem to fix on my own.

    Im trying to create a simple plugin to stop the creation of certain items (code below) but no matter what i cant get it to work

    Code (Text):
        @Override
        public void onEnable(){
            getServer().getPluginManager().registerEvents(this, this);
        }

       
       
        public void onDisable(){
           
        }
       
        @EventHandler
        public void onCraft(CraftItemEvent e){
           
            if (e.getRecipe() == null){
                return;
            }
            if (e.getRecipe().getResult() == new ItemStack(Material.GOLDEN_APPLE, 1)){
            e.setCancelled(true);
           
            }
        }
    }
     
    • Optimistic Optimistic x 1
Thread Status:
Not open for further replies.