NoHopper
Removes the Hoppper Recipeunknown
java
a year ago
814 B
7
Indexable
public class NoHopperCraft extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
removeHopperRecipe();
}
private void removeHopperRecipe() {
NamespacedKey hopperKey = NamespacedKey.minecraft("hopper");
Recipe recipe = Bukkit.getRecipe(hopperKey);
if (recipe != null) {
Bukkit.removeRecipe(hopperKey);
getLogger().info("Hopper crafting recipe removed.");
}
}
@EventHandler
public void onPrepareItemCraft(PrepareItemCraftEvent event) {
if (event.getInventory().getResult() != null &&
event.getInventory().getResult().getType() == Material.HOPPER) {
event.getInventory().setResult(null);
}
}
}Editor is loading...
Leave a Comment