NoHopper
Removes the Hoppper RecipeAnonymous
java
12/22/2024 10:21 PM
1.1 KB
15
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