oxy1337_

create a plugin for my minecraft paper server called DonutNV that when i do /nv it enables Night Vision and when i activate or desactivate it shows a text up of the health bar like the thing bar at the middle night vision activated in white text

Kodari AI
KodariMar 24 at 11:11 am 6,608 (v2)

I’ll create a Paper plugin that toggles night vision with an action bar message.

DonutNV
A lightweight night vision toggle plugin for Paper servers. Players can use /nv to instantly enable or disable night vision with a clean action bar notification displayed above their health bar. Features MiniMessage support for modern text formatting and XSeries for cross-version compatibility.

Created DonutNV plugin with /nv command that toggles night vision and displays action bar messages above the health bar using MiniMessage formatting.

oxy1337_

it didn't clear enderchest

Kodari AI
KodariMar 24 at 6:40 pm 4,989 (v2)

I need to read the existing files to understand the current functionality and identify why the ender chest isn’t being cleared.

This is a night vision toggle plugin - it doesn’t have any ender chest clearing functionality. Could you clarify what you’d like?

Do you want to:

  1. Add a command to clear ender chests to this plugin?

  2. Make the /nv command also clear the player’s ender chest when toggling night vision?

  3. Something else?

Please let me know what functionality you’re looking for and I’ll implement it.

oxy1337_

when i get killed night vision disables

Kodari AI
KodariMar 24 at 6:45 pm 2,356 (v2)

I’ll read the current plugin files to identify why night vision is being disabled on death.

I can see the issue. When you die, Minecraft removes all potion effects by default. The plugin needs to track who has night vision enabled and reapply it when they respawn.

I’ll add a respawn listener to automatically restore night vision after death:

Night vision will now persist through death. The plugin tracks who has it enabled and automatically reapplies it when you respawn.

oxy1337_

still the same when i dit it doesnt re enable it

Kodari AI
KodariMar 24 at 6:49 pm 5,495 (v2)

I need to read the current files to see what’s happening with the night vision re-enable on respawn.

I see the issue! The night vision effect is being applied too early in the respawn process. We need to delay it by 1 tick to ensure the player is fully loaded.

Fixed! The issue was that the night vision effect was being applied too early in the respawn process. I’ve added a 1-tick delay to ensure the player is fully loaded before applying the effect.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 178
src/main/java/com/donut/donutnv/DonutNV.java
package com.donut.donutnv;

import com.donut.donutnv.commands.NightVisionCommand;
import com.donut.donutnv.listeners.RespawnListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class DonutNV extends JavaPlugin {

    @Getter
    private NightVisionManager nightVisionManager;

    @Override
    public void onEnable() {
        this.nightVisionManager = new NightVisionManager();

        getCommand("nv").setExecutor(new NightVisionCommand(this));
        getServer().getPluginManager().registerEvents(new RespawnListener(this), this);

        getLogger().info("DonutNV has been enabled!");
    }

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