im_enta

Create a Paper/Spigot plugin called FarmingPlus that adds farming and cooking mechanics inspired by Farmer's Delight. Include the following features:

  1. CUSTOM CROPS
  • Add plantable crops: tomatoes, onions, rice, cabbage
  • Each crop has multiple growth stages
  • Crops drop their respective food items when fully grown
  1. CUTTING BOARD MECHANIC
  • When a player right clicks a crafting table while sneaking and holding a knife, open a custom INVENTORY GUI called "Cutting Board"
  • Players can place food items in it and get chopped versions (e.g. tomato โ†’ chopped tomato, carrot โ†’ carrot slice)
  1. COOKING POT MECHANIC
  • Place a cauldron over a campfire to activate it as a cooking pot
  • Right click the cooking pot to open a INVENTORY GUI where players can add ingredients
  • After 30 seconds of ingredients being inside, it produces a stew or meal item
  1. CUSTOM FOOD ITEMS
  • Add these custom food items using CustomModelData:

- Tomato (restores 2 hunger) - Chopped Tomato (restores 1 hunger) - Onion (restores 2 hunger) - Rice (restores 3 hunger) - Cabbage (restores 2 hunger) - Vegetable Stew (restores 8 hunger, gives regeneration for 5 seconds) - Rice Bowl (restores 6 hunger) - Roast Chicken (restores 10 hunger, gives strength for 10 seconds)

  1. KNIFE ITEM
  • Custom item using CustomModelData on a iron sword
  • Used to chop food on the cutting board
  • Has 100 durability uses
  1. CUSTOM RECIPES
  • Tomato seed โ†’ plant to grow tomato
  • Rice + Bowl = Rice Bowl (shaped crafting)
  • Vegetable Stew ingredients: tomato + onion + cabbage + bowl = cooked in cooking pot
  1. NATURAL CROP SPAWNING
  • Tomatoes and cabbage occasionally spawn in village farms naturally

Please generate the full plugin with all necessary files including plugin.yml, config.yml, and all Java classes. Make sure it works on Paper 1.21.11

Kodari AI
KodariMar 20 at 3:13 pm 23,268 (v2)

Iโ€™ll create a comprehensive farming and cooking plugin with custom crops, cutting board mechanics, cooking pots, and inventory-based GUIs.

FarmingPlus
A comprehensive farming and cooking plugin inspired by Farmer's Delight. Features custom crops (tomatoes, onions, rice, cabbage), a cutting board system for food preparation, cooking pots for creating meals, and custom food items with buffs. Includes natural village crop spawning, custom knife tools, and interactive inventory GUIs for cooking and food preparation.

FarmingPlus plugin complete with custom crops, cutting board mechanics, cooking pots, and inventory-based GUIs fully implemented using the GUI framework.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
24 1,530
src/main/java/com/farmingplus/FarmingPlus.java
package com.farmingplus;

import com.farmingplus.commands.FarmingPlusCommand;
import com.farmingplus.inventory.gui.GUIListener;
import com.farmingplus.inventory.gui.GUIManager;
import com.farmingplus.listeners.CookingPotListener;
import com.farmingplus.listeners.CropListener;
import com.farmingplus.listeners.CuttingBoardListener;
import com.farmingplus.listeners.VillageSpawnListener;
import com.farmingplus.managers.CookingPotManager;
import com.farmingplus.managers.CropManager;
import com.farmingplus.managers.ItemManager;
import com.farmingplus.managers.RecipeManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class FarmingPlus extends JavaPlugin {
    private ItemManager itemManager;
    private CropManager cropManager;
    private GUIManager guiManager;
    private RecipeManager recipeManager;
    private CookingPotManager cookingPotManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.itemManager = new ItemManager(this);
        this.cropManager = new CropManager(this);
        this.guiManager = new GUIManager();
        this.recipeManager = new RecipeManager(this);
        this.cookingPotManager = new CookingPotManager(this);

        registerListeners();
        registerCommands();

        this.recipeManager.registerRecipes();
        this.cropManager.startGrowthTask();
        this.cookingPotManager.startCookingTask();

        getLogger().info("FarmingPlus has been enabled!");
    }

    @Override
    public void onDisable() {
        this.cropManager.stopGrowthTask();
        this.cookingPotManager.stopCookingTask();
        getLogger().info("FarmingPlus has been disabled!");
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new CropListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CuttingBoardListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CookingPotListener(this), this);
        Bukkit.getPluginManager().registerEvents(new VillageSpawnListener(this), this);
    }

    private void registerCommands() {
        getCommand("farmingplus").setExecutor(new FarmingPlusCommand(this));
    }
}