Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 53 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,67 @@
# AdvancedVanish
![license](https://img.shields.io/github/license/quantiom/EventHandler?color=%23b59e28&style=for-the-badge) ![made-with-kotlin](https://img.shields.io/badge/MADE%20WITH-KOTLIN-%23b59e28?style=for-the-badge&logo=java) ![last-commit](https://img.shields.io/github/last-commit/quantiom/AdvancedVanish?color=%23b59e28&style=for-the-badge)

AdvancedVanish is a fully customizable and advanced vanish plugin made with Kotlin.
A fully customizable and advanced vanish plugin for Spigot-based Minecraft servers.

Spigot Resource: https://www.spigotmc.org/resources/advancedvanish.86036/
## Features

GitBook: https://quantioms.gitbook.io/advancedvanish/
- Toggle vanish for yourself and other players.
- Control whether you can interact with blocks while vanished.
- View a list of vanished players.
- Check the vanish status of any player.
- Vanish priority system.
- Support for various popular plugins like LuckPerms, PlaceholderAPI, and Essentials.

## Features
- Fully customizable through the [config](src/main/resources/config.yml). (70+ options)
- Messages
- Permissions
- Actions
- Hooks
- Placeholders
- Much more...
- Vanished players are **completely** invisible, as if they are not even online.
- Vanish priorities/levels ([more info](https://quantioms.gitbook.io/advancedvanish/features#vanish-priorities))
- Supports many different permissions plugins. (LuckPerms, PermissionsEx, bPermissions, GroupManager)
- Many configurable hooks which provide support to other plugins.
- Essentials
- PlaceholderAPI
- DiscordSRV
- Dynmap
- Much more...
- Togglable Actions when vanished (15+)
- Commands:
- `/vanish` *- Toggle vanish.*
- `/vanish reload` *- Reloads the config and hooks*
- `/vanish priority` *- Displays your vanish priority.*
- `/vanish list` *- Dispalys a list of vanished players.*
- `/vanish status <player>` *- Check if a player is in vanish.*
- `/vanish set <player> <on/off>` *- Set another player's vanish.*
- `/vanish toggle <player>` *- Toggle another player's vanish.*
- `/vanish interact` *- Toggles interacting while in vanish*
- Cross Server Vanish Synchronization
- For the rest of the features, check out the [GitBook page](https://quantioms.gitbook.io/advancedvanish/).
## Commands

| Command | Description | Aliases |
|---------------------------------|----------------------------------------------|-------------------------|
| `/vanish` | Toggle your vanish status. | `/v`, `/advancedvanish` |
| `/vanish version` | Shows the plugin version. | |
| `/vanish reload` | Reloads the configuration and hooks. | |
| `/vanish interact` | Toggle block interaction while vanished. | |
| `/vanish priority` | Displays your vanish priority. | |
| `/vanish list` | Lists all vanished players. | |
| `/vanish status <player>` | Check if a player is vanished. | |
| `/vanish set <player> <on/off>` | Set another player's vanish status. | |
| `/vanish toggle <player>` | Toggle another player's vanish status. | |
| `/vanish help` | Displays the help message. | |

## Hooks
In AdvancedVanish, there are many hooks which provide support to other plugins.
A full list of hooks with their descriptions can be found on the [GitBook page](https://quantioms.gitbook.io/advancedvanish/features#hooks).
## Permissions

## Vanish Priority
An explanation and guide of how to use vanish priorities can be found on the [GitBook page](https://quantioms.gitbook.io/advancedvanish/features#vanish-priorities).
*Note: Requires a supported permissions plugin to function*
| Permission | Description | Default |
|----------------------------------------|----------------------------------------------------| ---------- |
| `advancedvanish.vanish` | Allows toggling your own vanish status. | `true` |
| `advancedvanish.version-command` | Allows using the `/vanish version` command. | `true` |
| `advancedvanish.reload-config-command` | Allows using the `/vanish reload` command. | `op` |
| `advancedvanish.interact-command` | Allows using the `/vanish interact` command. | `op` |
| `advancedvanish.priority-command` | Allows using the `/vanish priority` command. | `true` |
| `advancedvanish.list-command` | Allows using the `/vanish list` command. | `op` |
| `advancedvanish.status-command` | Allows using the `/vanish status` command. | `op` |
| `advancedvanish.set-other-command` | Allows using the `/vanish set` command. | `op` |
| `advancedvanish.toggle-other-command` | Allows using the `/vanish toggle` command. | `op` |
| `advancedvanish.help-command` | Allows using the `/vanish help` command. | `true` |
| `advancedvanish.see-vanished` | Allows seeing vanished players. | `op` |

## API
Before utilizing the API, make sure that the `AdvancedVanish` plugin is
enabled, or add `depend: [AdvancedVanish]` or `softdepend: [AdvancedVanish]` to
your plugin's `plugin.yml`.
*Note: The actual permission nodes are configurable in `config.yml`.*

### Maven
Add this repository to your `pom.xml`:
```xml
<repository>
<id>repsy</id>
<name>quantiom</name>
<url>https://repo.repsy.io/mvn/quantiom/minecraft</url>
</repository>
```
## Dependencies

Add the dependency and replace `<version>...</version>` with the current version:
```xml
<dependency>
<groupId>me.quantiom</groupId>
<artifactId>advancedvanish</artifactId>
<version>1.2.7</version>
</dependency>
```
AdvancedVanish has soft dependencies on the following plugins, which means it can integrate with them if they are installed, but they are not required for the plugin to run:

### Methods
```kotlin
AdvancedVanishAPI.vanishPlayer(player: Player): Unit
AdvancedVanishAPI.unVanishPlayer(player: Player): Unit
AdvancedVanishAPI.isPlayerVanished(player: Player): Boolean
AdvancedVanishAPI.canSee(player: Player, target: Player): Boolean
```
### Extensions
```kotlin
Player.isVanished(): Boolean
```
### Events
- `PrePlayerVanishEvent` - Gets called before vanishing a player, implements `Cancellable`.
- `PlayerVanishEvent` - Gets called after a player vanishes.
- `PrePlayerUnVanishEvent` - Gets called before a player unvanishes, implements `Cancellable`.
- `PlayerUnVanishEvent` - Gets called after a player unvanishes.
### Example Usage
```kotlin
class ExamplePlugin : JavaPlugin(), Listener {
override fun onEnable() {
this.server.pluginManager.registerEvents(this, this)
}
- LuckPerms
- PlaceholderAPI
- GroupManager
- PermissionsEx
- bPermissions
- DiscordSRV
- Dynmap
- squaremap
- LibsDisguises
- PlayerParticles
- Essentials
- ProtocolLib

@EventHandler
private fun onVanish(event: PlayerVanishEvent) {
val vanishedPlayers = AdvancedVanishAPI.vanishedPlayers
.map(Bukkit::getPlayer)
.joinToString(", ", transform = Player::getName)
## Configuration

this.logger.log(Level.INFO, "${event.player.name} has entered vanish.")
this.logger.log(Level.INFO, "Current vanished players: ${vanishedPlayers}.")
}
The plugin is highly configurable. You can customize messages, permission nodes, and various other settings in the `config.yml` file.

@EventHandler
private fun onUnVanish(event: PrePlayerUnVanishEvent) {
event.isCancelled = true // Don't let players unvanish
}
}
```
92 changes: 60 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>me.quantiom</groupId>
<artifactId>advancedvanish</artifactId>
<version>1.2.7</version>
<version>2026.5.0</version>
<packaging>jar</packaging>

<name>AdvancedVanish</name>
Expand All @@ -22,13 +22,13 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.version>2.1.0</kotlin.version>
<kotlin.version>2.2.0</kotlin.version>
<kotlin.code.style>official</kotlin.code.style>
<junit.version>4.13.2</junit.version>
<config.version>10</config.version>

<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties>

Expand All @@ -41,17 +41,13 @@
<id>aikar</id>
<url>https://repo.aikar.co/content/groups/aikar/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
</repository>
<repository>
<id>ess-repo</id>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
<repository>
<id>paper-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>jitpack.io</id>
Expand Down Expand Up @@ -85,15 +81,13 @@
<id>md_5-public</id>
<url>https://repo.md-5.net/content/groups/public/</url>
</repository>
<repository>
<id>purpur-repo</id>
<url>https://repo.purpurmc.org/snapshots</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
Expand All @@ -106,23 +100,22 @@
<version>0.5.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.luckperms/api -->
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<groupId>net.dmulloy2</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.3.0</version>
<version>5.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.20.1</version>
<version>2.21.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -134,7 +127,7 @@
<dependency>
<groupId>com.discordsrv</groupId>
<artifactId>discordsrv</artifactId>
<version>1.28.0</version>
<version>1.30.5</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -156,7 +149,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>LibsDisguises</groupId> <!-- md_5 moment -->
<groupId>LibsDisguises</groupId>
<artifactId>LibsDisguises</artifactId>
<version>10.0.44</version>
<scope>provided</scope>
Expand All @@ -171,31 +164,31 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>5.1.1</version>
<version>7.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-core</artifactId>
<version>0.47.0</version>
<version>0.50.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-dao</artifactId>
<version>0.47.0</version>
<version>0.50.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-jdbc</artifactId>
<version>0.47.0</version>
<version>0.50.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.byteflux</groupId>
<artifactId>libby-bukkit</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand All @@ -208,11 +201,6 @@
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -320,6 +308,46 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>co.aikar.commands</pattern>
<shadedPattern>me.quantiom.advancedvanish.shaded.acf.commands</shadedPattern>
</relocation>
<relocation>
<pattern>co.aikar.locales</pattern>
<shadedPattern>me.quantiom.advancedvanish.shaded.acf.locales</shadedPattern>
</relocation>
<relocation>
<pattern>kotlin</pattern>
<shadedPattern>me.quantiom.advancedvanish.shaded.kotlin</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>
4 changes: 2 additions & 2 deletions src/main/kotlin/me/quantiom/advancedvanish/AdvancedVanish.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ object AdvancedVanish {
fun onDisable() {
ServerSyncManager.close()
VanishStateManager.onDisable()
AdvancedVanishAPI.vanishedPlayers.map(Bukkit::getPlayer).forEach { AdvancedVanishAPI.unVanishPlayer(it!!) }
AdvancedVanishAPI.vanishedPlayers.mapNotNull(Bukkit::getPlayer).forEach { AdvancedVanishAPI.unVanishPlayer(it) }
HooksManager.disableHooks()
commandManager?.unregisterCommand(VanishCommand)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

import org.bukkit.plugin.java.JavaPlugin;

/**
* This class is written in Java only because of the
* dependency management system. After Kotlin is loaded, the
* AdvancedVanish Kotlin class will take over.
*
* Basically, this class just acts as a "loader".
*/

public class AdvancedVanishPlugin extends JavaPlugin {
@Override
public void onEnable() {
Expand Down
Loading