justweby

Make a minecraft 1.21.x plugin where when i do /auto-creative (user) (in this much time he gets creative after joining the server) (in how much time the creative goes away) also it should be fully working :)

Kodari AI
KodariApr 15 at 6:41 pm 11,143 (v2)

I’ll create a Minecraft plugin that automatically gives players creative mode when they join, with configurable delays.

AutoCreative
Automatically grants creative mode to specific players after they join the server. Admins can configure individual join delays and creative duration per player using a simple command. Features persistent data storage, automatic gamemode switching, and player notifications. Perfect for giving temporary creative access to trusted players or for minigame setups.

Plugin created successfully!

Features:

  • /auto-creative <player> <joinDelay> <duration> - Configure auto-creative for any player

  • /auto-creative remove <player> - Remove auto-creative configuration

  • Persistent storage in data.yml

  • Scheduled gamemode switching with player notifications

  • Works with online and offline players

Example usage:

  • /auto-creative Steve 10 60 - Give Steve creative mode 10 seconds after joining, remove it after 60 seconds

  • /auto-creative remove Steve - Cancel Steve’s auto-creative

justweby

Every 10 seconds he again gets the creative

Kodari AI
KodariApr 15 at 6:44 pm 1,233 (v2)

I need to read the project files to identify the bug causing players to repeatedly get creative mode every 10 seconds.

[Generation stopped]

justweby

I want the player to get the creative again after the duration i set and remove it again after the duration i set

Kodari AI
KodariApr 15 at 6:47 pm 5,824 (v2)

I need to read the existing files to understand the current implementation before adding the cycling functionality.

I’ll modify the system to create a repeating cycle where creative mode is granted and removed repeatedly based on your configured durations.

The plugin now cycles creative mode automatically:

  • After join delay: creative enabled

  • After duration: creative disabled

  • After join delay: creative enabled again

  • Repeats until player logs off

The cycle is properly cancelled when players quit or when the plugin disables.

justweby

Can you add a feature so, that only the players i have given the autocreative thing will have a timer on their xpbar or above it? Pls?

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 458
src/main/java/com/autocreative/plugin/AutoCreative.java
package com.autocreative.plugin;

import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
import com.autocreative.plugin.manager.AutoCreativeManager;
import com.autocreative.plugin.manager.ConfigManager;
import com.autocreative.plugin.command.AutoCreativeCommand;
import com.autocreative.plugin.listener.JoinListener;
import com.autocreative.plugin.listener.QuitListener;

@Getter
public class AutoCreative extends JavaPlugin {
    private AutoCreativeManager autoCreativeManager;
    private ConfigManager configManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.autoCreativeManager = new AutoCreativeManager(this);
        
        getCommand("auto-creative").setExecutor(new AutoCreativeCommand(this));
        getServer().getPluginManager().registerEvents(new JoinListener(this), this);
        getServer().getPluginManager().registerEvents(new QuitListener(this), this);
        
        getLogger().info("AutoCreative has been enabled!");
    }

    @Override
    public void onDisable() {
        if (autoCreativeManager != null) {
            autoCreativeManager.stopAllCycles();
            autoCreativeManager.saveData();
        }
        getLogger().info("AutoCreative has been disabled!");
    }
}