Disable God Apple Crafting

Discussion in 'Spigot Plugin Development' started by RedNinjaPuppy, Aug 14, 2018.

Thread Status:
Not open for further replies.
  1. Hi, so I was wondering what to do to disable the crafting recipe of a god apple.

    Code (Text):
            if (event.getRecipe().getResult().getType() == Material.HOPPER) {
                event.setCancelled(true);
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&l[!] &7You cannot craft a hopper!"));
            }
    This is what I am using for hoppers, but a god apple is GOLDEN_APPLE:1 so I cannot use it in this.
     
  2. FrostedSnowman

    Resource Staff

    check if the material is golden apple and the durability is 1
     
  3. Okay, thanks a lot Got it working.
     
  4. I know this has been solved, but if you are making this plugin for 1.13, you can use:
    Code (Text):
    if (event.getRecipe().getResult().getType() == Material.ENCHANTED_GOLDEN_APPLE) {
                event.setCancelled(true);
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&l[!] &7You cannot craft a god apple!"));
            }
     
    • Like Like x 1
Thread Status:
Not open for further replies.