Skip to content

Vanish and Config Queries

Gugas749 edited this page Nov 5, 2026 · 1 revision

Outside the API package: vanish and config queries

These classes live outside api, so they are not part of the official API and may change. Read-only queries are safe and useful, for example to respect vanish in your own player lists, radars or "nearby players" features.

import com.gugas749.abysscore.features.vanish.VanishManager;
import com.gugas749.abysscore.features.vanish.VanishOption;

VanishManager.isVanished(player);                 // Entity overload: true only for a vanished SERVER player
VanishManager.isVanished(uuid);
VanishManager.canSee(viewer, target);             // THE visibility rule (staff level, teams, show/hide exceptions)
VanishManager.getVanished();                      // Set<UUID>, read-only
VanishManager.hiddenFrom(target);                 // online players who can NOT see target
VanishManager.isActive(player, VanishOption.NO_PICKUP);   // vanished AND that option on
VanishManager.getOption(uuid, VanishOption.MOBS_IGNORE);

Example — don't reveal vanished staff in your mod's player list packet:

List<UUID> visible = server.getPlayerList().getPlayers().stream()
        .filter(p -> VanishManager.canSee(viewer, p))
        .map(Entity::getUUID)
        .toList();
MyPackets.CHANNEL.sendToPlayer(viewer, new PlayerListPacket(visible));

Changing state also exists (VanishManager.setVanished(player, bool), toggle(player), setOption(player, option, bool)), but prefer the /abysscore vanish commands.

Server config (read-only):

import com.gugas749.abysscore.AbysscoreServerConfig;

AbysscoreServerConfig.isChatLockEnabled();
AbysscoreServerConfig.getVanishSeeLevel();   // AbyssPermissionLevel

ResourceLocation on both versions: com.gugas749.abysscore.Constants.id(namespace, path) builds a ResourceLocation on 1.20.1 and 1.21.1 (it uses ResourceLocation.tryBuild and throws on invalid characters). It's handy if you write one source tree for both versions.

Clone this wiki locally