12345bartek

Generate a plugin for an item that, when right-clicked, places a schematic that you previously added to the schematic folder. The config should include a space for the item name, a space for the item's lore, and a space for the name of the schematic that will be generated. The plugin should have a reload function, the schematic should not have a duration, but should be permanent after placement, and the plugin should have a reload command.

Kodari AI
KodariFeb 27 at 4:24 pm 12,924 (v2)

I’ll create a plugin that places WorldEdit schematics via right-click on a custom item.

SchematicItem
A plugin that allows players to place permanent WorldEdit schematics by right-clicking a custom item. Configure item details and schematic file names through config.yml. Includes reload command for config changes and integrates with WorldEdit API for schematic placement.

I’ll create a schematic placement plugin with WorldEdit integration.

Plugin created successfully with:

  • Custom item identified by PersistentDataContainer

  • Config-based item name, lore, and schematic selection

  • WorldEdit integration for permanent schematic placement

  • /schematicitem reload to reload config

  • /schematicitem give [player] to obtain the item

  • Item consumed on use (unless in creative mode)

  • Schematic placement at clicked block or player location

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 439
src/main/java/com/example/schematicitem/SchematicItem.java
package com.example.schematicitem;

import com.example.schematicitem.commands.ReloadCommand;
import com.example.schematicitem.listeners.SchematicListener;
import com.example.schematicitem.managers.ConfigManager;
import com.example.schematicitem.managers.SchematicManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SchematicItem extends JavaPlugin {
    private ConfigManager configManager;
    private SchematicManager schematicManager;

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

        this.configManager = new ConfigManager(this);
        this.schematicManager = new SchematicManager(this);

        Bukkit.getPluginManager().registerEvents(new SchematicListener(this), this);
        getCommand("schematicitem").setExecutor(new ReloadCommand(this));

        getLogger().info("SchematicItem enabled successfully!");
    }

    @Override
    public void onDisable() {
        getLogger().info("SchematicItem disabled!");
    }

    public void reload() {
        reloadConfig();
        this.configManager = new ConfigManager(this);
    }
}