Emanuel Dzobakova

Create Gacha Machine with Animations

Kodari AI
KodariOct 13 at 9:09 am 5
GachaMachineAnimations
A Minecraft plugin that adds interactive gacha machines with animated opening sequences. Players purchase spins using in-game currency, triggering a 3D animated machine that shakes, glows, and dispenses random rewards with particle effects. Features configurable reward tables with rarity tiers, holographic displays showing drop rates, cooldown management, and GUI-based reward collection. Includes customizable machine models via armor stands, sound effects, and visual feedback for legendary drops. Supports multiple machine locations, permission-based access, and economy integration for seamless currency handling.

I’ll build this as a Vault-backed gacha plugin with weighted rewards, a reel animation, particles and sounds, and two example pools.

The Gacha Machine plugin is built. Players open a pool GUI with /gacha <pool>, press the roll button, and watch a reel spin before the reward lands.

What’s in it

  • Reel animation: The reel shifts one slot per step and slows down over about four seconds. The reward is chosen up front by weight, so the animation always lands on the correct item.

  • Effects: Each reel step plays a click sound and particles. The reveal plays a rarity-specific sound and particle burst, and sends a title and chat message.

  • Pools and rarities: Pools, rewards, weights, costs and rarity styles all live in config.yml. The default config has two example pools, basic and premium.

  • Rewards: Each reward can give items and run console commands with %player%. Rewards marked broadcast: true are announced server-wide.

  • Safety: Clicks inside the GUI are blocked. A second roll is refused while one is running. If a player closes the GUI or quits mid-spin, the reward is delivered immediately, so nothing is lost.

  • Paid rolls: Costs are charged through Vault. If Vault is missing, paid pools refuse to roll and free pools still work.

Commands

  • /gacha lists the pools.

  • /gacha <pool> opens a pool.

  • /gacha reload reloads the config (requires gacha.admin).

Files: plugin.yml, config.yml, and 9 Java classes under com.kodari.gacha. The build file is not included, since XSeries and Vault are already set up in the project.

Testing hasn’t been done yet. A few things to check when you compile and try it:

  • The particle and sound names are resolved through XSeries. If a name isn’t found on your server version, that effect is skipped silently.

  • Rolls currently open from a GUI only. If you want a physical machine block in the world, that can be added next.

Kodari can make mistakes. Review important code before using.
Files
src
Code
11 858
src/main/java/com/kodari/gacha/GachaPlugin.java
package com.kodari.gacha;

import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class GachaPlugin extends JavaPlugin {

    @Getter
    private GachaManager gachaManager;
    @Getter
    private Economy economy;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        if (!setupEconomy()) {
            getLogger().warning("Vault economy not found - paid pools will be unavailable.");
        }

        gachaManager = new GachaManager(this);
        gachaManager.load();

        GachaCommand command = new GachaCommand(this);
        getCommand("gacha").setExecutor(command);
        getCommand("gacha").setTabCompleter(command);
        getServer().getPluginManager().registerEvents(new GachaListener(this), this);
    }

    @Override
    public void onDisable() {
        if (gachaManager != null) {
            gachaManager.shutdown();
        }
    }

    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> provider = getServer().getServicesManager().getRegistration(Economy.class);
        if (provider == null) {
            return false;
        }
        economy = provider.getProvider();
        return true;
    }
}