baltykfr

Requirements:

Freeze Mechanism: When a player joins, cancel the PlayerMoveEvent to prevent them from moving or jumping. Also, prevent them from breaking blocks or interacting with the world until registered.

Registration Prompt: On join, send a message to the player: "Wpisz /register [haslo] [powtorz haslo]".

The Command: Create a /register <password> <confirmPassword> command.

Logic: > * Check if the player is already registered (use a simple HashSet for session management and a YamlConfiguration to save passwords).

If the passwords match, 'unfreeze' the player and save their data.

If they don't match, send an error message.

Legacy Compatibility: Ensure the code uses Java 8 syntax and the 1.8.8 API methods (e.g., use ChatColor for colors).

Please provide the plugin.yml file and the main Java class code."

Kodari AI
KodariJan 22 at 1:45 pm 2,887 (v2)

I’ll create a legacy 1.8.8 registration plugin with freeze mechanics and password authentication.

FreezeRegister
A lightweight 1.8.8-compatible registration plugin that freezes players upon joining until they register with a password. Features include movement blocking, interaction prevention, password validation with confirmation, and persistent data storage using YAML. Uses HashSet for session management and ensures players cannot move, break blocks, or interact with the world until successfully registered.

Plugin created with full freeze mechanics and legacy 1.8.8 compatibility. Players are frozen until they register, preventing movement, block breaking, and interactions. Uses HashSet for session tracking and YamlConfiguration for persistent password storage.

baltykfr

plugin not showing when i type /plugins in chat why

Kodari AI
KodariJan 22 at 1:46 pm 2,651 (v2)

The plugin configuration looks correct. The issue is likely one of these:

Common causes:

  1. Plugin not compiled - You need to build the JAR file first

  2. JAR not in plugins folder - After building, copy build/libs/FreezeRegister-1.0.jar to your server’s plugins/ folder

  3. Server not restarted - Restart the server after adding the plugin

  4. Build errors - Check if the build actually succeeded

To fix:

  1. Build the plugin:

    Plain Text
    ./gradlew build
    
  2. Find the JAR in build/libs/FreezeRegister-1.0.jar

  3. Copy it to your server’s plugins/ folder

  4. Restart your server (not just reload)

  5. Check console for “FreezeRegister enabled!” message

If still not working, check:

  • Server console for errors during startup

  • Make sure you’re running Spigot/Paper/Bukkit (not vanilla Minecraft)

  • Verify the JAR file is actually in the plugins folder

  • Check server logs in logs/latest.log

The plugin code itself is fine - this is a deployment issue, not a code issue.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
5 209
src/main/java/pl/freezeregister/FreezeRegister.java
package pl.freezeregister;

import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.UUID;

public class FreezeRegister extends JavaPlugin {

    private HashSet<UUID> registeredPlayers;
    private File dataFile;
    private YamlConfiguration dataConfig;

    @Override
    public void onEnable() {
        registeredPlayers = new HashSet<UUID>();
        
        dataFile = new File(getDataFolder(), "players.yml");
        if (!dataFile.exists()) {
            try {
                dataFile.getParentFile().mkdirs();
                dataFile.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        dataConfig = YamlConfiguration.loadConfiguration(dataFile);
        
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        getCommand("register").setExecutor(new RegisterCommand(this));
        
        getLogger().info("FreezeRegister enabled!");
    }

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

    public boolean isRegistered(UUID uuid) {
        return registeredPlayers.contains(uuid);
    }

    public void registerPlayer(UUID uuid, String password) {
        registeredPlayers.add(uuid);
        dataConfig.set(uuid.toString(), password);
        saveData();
    }

    public boolean hasAccount(UUID uuid) {
        return dataConfig.contains(uuid.toString());
    }

    public void loadPlayerSession(UUID uuid) {
        if (hasAccount(uuid)) {
            registeredPlayers.add(uuid);
        }
    }

    private void saveData() {
        try {
            dataConfig.save(dataFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}