mpeyboun_83492

Make a plugin name nightvision. This plugin when player execute command /nv or /nightvision it will apply unlimited night vision to player when it's on. Make the plugin save player status also if player died or quit server or pop totem but if the status is on the night vision still apply also until it off. Make it has customize in config also. Make it has reload command. Make all command working with console and player. Make if command execute by console it will no send messages to player but change status. Make it has placeholder to show status also "%nv_status%" If on "&#02FB00&lON" if off "&#ff0000&lOFF". Make it working with hex color and legacy color. Author kdmv. Version 1.20 + 1.21.11

Kodari AI
KodariMar 1 at 1:20 am 9,002 (v2)

I’ll create a night vision toggle plugin with persistent status and PlaceholderAPI support.

NightVision
A persistent night vision toggle plugin allowing players to enable unlimited night vision effects via commands. Features automatic status persistence through deaths, server restarts, and totem revivals. Includes PlaceholderAPI integration for status displays with hex color support, console compatibility for remote player management, and full configuration customization. Supports both legacy and modern hex color codes.

Plugin created with the following features:

  • /nv and /nightvision commands toggle persistent night vision

  • Console can change player status without sending messages to the player

  • Status persists through death, quit, respawn, and totem pops

  • PlaceholderAPI support with %nv_status% showing customizable ON/OFF with hex colors

  • Reload command /nvreload for configuration updates

  • Full hex color (&#RRGGBB) and legacy color (&c) support

  • All settings customizable in config.yml

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 1,504
src/main/java/xyz/kunthean/pensettings/PenSettings.java
package xyz.kunthean.pensettings;

import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PenSettings extends JavaPlugin {

    private ConfigManager configManager;
    private DataManager dataManager;
    private GUIManager guiManager;

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

        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        this.guiManager = new GUIManager(this);

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(new PlayerListener(this, guiManager, dataManager), this);

        SettingsCommand cmd = new SettingsCommand(this);
        getCommand("settings").setExecutor(cmd);
        getCommand("settings").setTabCompleter(cmd);
        getCommand("pensettings").setExecutor(cmd);
        getCommand("pensettings").setTabCompleter(cmd);

        getLogger().info("PenSettings has been enabled.");
    }

    @Override
    public void onDisable() {
        if (dataManager != null) dataManager.saveAll();
        if (dataManager != null) dataManager.close();
        getLogger().info("PenSettings has been disabled.");
    }

    public void reload() {
        configManager.load();
        dataManager.reload();
        guiManager.invalidateAllCaches();
    }
}