azectzz

make a plugin so when a player does "/freepet" a INVENTORY GUI opens and the INVENTORY GUI size is 63 slots, there are 8 items that spin around in a loop for 5 seconds, you must be able to add itemsadder model data and lore in the config.yml for each of the 8 slots where items spin around, you must be able to name the INVENTORY GUI and add a command to each of the items so when someone wins it, the console executes the command.

Kodari AI
KodariMay 5 at 9:23 pm 8,807 (v2)

I’ll create a spinning pet lottery plugin with a customizable GUI where 8 items rotate in a circle for 5 seconds.

FreePetSpinner
An interactive spinning lottery GUI plugin where players use /freepet to spin a wheel of 8 configurable items. Items rotate in a circular pattern for 5 seconds before landing on a winner. Each item supports ItemsAdder custom model data, custom lore, and executes a console command when won. Fully configurable GUI title, item materials, and rewards through config.yml.

All files created! The plugin features:

  • 8 items spinning in a circular pattern (slots 20→21→22→31→40→39→38→29)

  • 5-second spin animation with gradual slowdown

  • Fully configurable items with ItemsAdder custom model data support

  • Console command execution on win with %player% placeholder

  • Customizable GUI title and win messages

azectzz

this is the error it gave me, the command does not work

1 image attached
Kodari AI
KodariMay 5 at 9:27 pm 8,721 (v2)

I see the issue! The error shows Size for custom inventory must be a multiple of 9 between 9 and 54 (Got 63). Bukkit only allows inventory sizes up to 54 slots (6 rows), not 63. Let me fix this and clean up the duplicate command files.

Now I’ll fix the issues:

  1. Change inventory size from 63 to 54 (max allowed)

  2. Delete the duplicate command file

  3. Update the config

Fixed! The plugin now:

  • Uses 54 slots (maximum allowed by Bukkit) instead of 63

  • Removed the duplicate FreePetCommand file

  • Fixed config.yml to use proper item keys (item1-item8) and placeholders (%player%, %item%)

The 8 items will still spin in a circle pattern within the 54-slot inventory. Try /freepet again and it should work!

azectzz

this is the error it gave me, the command does not work

1 image attached
Kodari AI
KodariMay 5 at 9:30 pm 6,429 (v2)

I see the error is still showing size 63. Let me read the actual files to see what’s currently in them:

The files look correct with size 54. The error in your screenshot shows it’s still trying to use 63. This means the server is running old compiled code. You need to restart your server (not just reload) to recompile the plugin with the new changes.

Try:

  1. Stop your server completely

  2. Start it again

  3. Run /freepet

The inventory size is correctly set to 54 in the code, but your server is still running the old version with 63.

azectzz

it is still giving this erroe#r after i added the new plugin

1 image attached
Kodari AI
KodariMay 5 at 9:32 pm 6,388 (v2)

I see the error is still happening. Let me read the current SpinnerGUI file to check what’s actually in it:

The code shows 54, which is correct. The issue is that your server compiled the plugin when it had 63, and hasn’t recompiled.

Looking at your error screenshot more carefully, I see:

Plain Text
at com.freepet.inventory.impl.SpinnerGUI.createInventory(SpinnerGUI.java:33)

The error is happening at line 33 in the old compiled version. You need to delete the compiled plugin JAR from your server’s plugins folder and rebuild:

  1. Stop your server

  2. Delete plugins/FreePetSpinner-1.0.0.jar (or whatever it’s called) from your server

  3. Rebuild the plugin using ./gradlew build or your IDE’s build button

  4. Copy the new JAR from build/libs/ to your server’s plugins/ folder

  5. Start your server

The server is running cached bytecode from the old version with 63 slots. Simply restarting won’t fix it - you need to replace the JAR file.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
12 596
src/main/java/com/freepet/FreePetPlugin.java
package com.freepet;

import com.freepet.commands.FreePetCommand;
import com.freepet.config.ConfigManager;
import com.freepet.inventory.gui.GUIListener;
import com.freepet.inventory.gui.GUIManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class FreePetPlugin extends JavaPlugin {
    
    @Getter
    private GUIManager guiManager;
    
    @Getter
    private ConfigManager configManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.guiManager = new GUIManager();
        
        GUIListener guiListener = new GUIListener(guiManager);
        Bukkit.getPluginManager().registerEvents(guiListener, this);
        
        getCommand("freepet").setExecutor(new FreePetCommand(this));
        
        getLogger().info("FreePetSpinner has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("FreePetSpinner has been disabled!");
    }
}