Con

Whenever your not invisable you get telported with /tp to y -10000000 And add a /invisexception to be exempt from getting tp'd

Kodari AI
KodariOct 7 at 5:59 pm 1
VoidTeleportExempt
A Minecraft plugin that teleports all visible players to the void at Y=-10000000, forcing them into invisibility to avoid falling damage. When a player becomes invisible, they are automatically teleported back to their original location. Administrators can use /invisexception to add or remove players from the teleport exemption list, allowing them to remain visible without being sent to the void. The plugin tracks player visibility states and manages teleportation logic seamlessly.
  1. Create the Paper plugin scaffold.

  2. Check each player for the invisibility effect and teleport non-exempt players to Y = -10,000,000.

  3. Add /invisexception as a toggle for the command user’s exemption.

Created the Paper plugin. It checks players once per second and teleports anyone without the Invisibility potion effect to Y = -10,000,000. /invisexception toggles an exemption for the player who runs it; exemptions reset when the plugin restarts.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 91
src/main/java/com/kodari/invisibilityguard/InvisibilityGuardPlugin.java
package com.kodari.invisibilityguard;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

public final class InvisibilityGuardPlugin extends JavaPlugin implements Listener {
    private final Set<UUID> exemptPlayers = new HashSet<>();

    @Override
    public void onEnable() {
        getServer().getScheduler().runTaskTimer(this, this::checkPlayers, 0L, 20L);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!command.getName().equalsIgnoreCase("invisexception")) {
            return false;
        }
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used by a player.");
            return true;
        }

        UUID playerId = player.getUniqueId();
        if (exemptPlayers.remove(playerId)) {
            player.sendMessage("You are no longer exempt from the invisibility check.");
        } else {
            exemptPlayers.add(playerId);
            player.sendMessage("You are now exempt from the invisibility check.");
        }
        return true;
    }

    private void checkPlayers() {
        for (Player player : getServer().getOnlinePlayers()) {
            if (exemptPlayers.contains(player.getUniqueId()) || isInvisible(player)) {
                continue;
            }

            Location current = player.getLocation();
            player.teleport(new Location(player.getWorld(), current.getX(), -10_000_000.0,
                    current.getZ(), current.getYaw(), current.getPitch()));
        }
    }

    private boolean isInvisible(Player player) {
        for (PotionEffect effect : player.getActivePotionEffects()) {
            if (effect.getType().getKey().getKey().equalsIgnoreCase("invisibility")) {
                return true;
            }
        }
        return false;
    }
}