SayanVanish
  • Introduction
  • Installation
  • Configuration
    • settings.yml
    • database.yml
    • <feature>.yml
  • Commands And Permissions
  • Placeholders
  • Features
    • Bukkit
      • Hooks
        • Citizens
        • DiscordSRV
        • Essentials
        • MiniPlaceholders
        • Pl3xMap
        • PlaceholderAPI
        • SquareMap
        • dynmap
        • TAB
        • LuckPerms
      • Prevent
        • Advancement Announce
        • Block Break
        • Block Grief
        • Block Place
        • Chat
        • Creature Target
        • Damage
        • Interact
        • Pickup
        • Push
        • Raid Trigger
        • Sculk Sensor
        • Server Ping
        • Spawner Spawn
        • Tab Complete
        • Food Level Change
      • Actionbar
      • Effect
      • Fake Message
      • Fly
      • Inventory Inspect
      • Invulnerability
      • Level
      • Proxy Vanish Queue
      • Silent Container
      • Sneak Toggle GameMode
      • State
      • Update
    • Proxy
      • Velocity
        • Hook
          • AdvancedServerList
          • EnhancedVelocity
          • MiniPlaceholders
          • TAB
          • Velocitab
          • LuckPerms
        • Prevent
          • Tab Complete
        • Sync Events
        • Update
        • Update Ping
      • Bungeecord
  • API
    • How It Works?
    • How to Use the API
    • Events
  • FAQ
  • Supported Plugins
Powered by GitBook
On this page
  1. API

How to Use the API

SayanVanish contains an extensive API to perform all necessary actions. To start, add the SayanVanish dependency to your build tool of choice, such as Maven or Gradle.

Adding the Repository

In Maven

<repository>
  <id>repo-sayandevelopment</id>
  <name>SayanDevelopment Repository</name>
  <url>https://repo.sayandev.org/snapshots</url>
</repository>

In Gradle

  • Groovy

maven {
    url "https://repo.sayandev.org/snapshots"
}
  • Kotlin

maven {
    url = uri("https://repo.sayandev.org/snapshots")
}

Adding the Dependency

You can use different platform-specific dependencies or the main platform-independent API.

Main API Dependency

The dependency artifact for the main API is sayanvanish-api.

Platform-Specific Dependencies

For platform-specific dependencies, the artifact ID follows the format sayanvanish-<platform>. Examples include sayanvanish-bukkit and sayanvanish-proxy-velocity.

In Maven

<dependency>
  <groupId>org.sayandev</groupId>
  <artifactId>sayanvanish-bukkit</artifactId>
  <version>[get version from github]</version>
</dependency>

In Gradle

  • Groovy

implementation "org.sayandev:sayanvanish-bukkit:[get version from github]"
  • Kotlin

implementation("org.sayandev:sayanvanish-bukkit:[get version from github]")

Accessing the API

You can access the SayanVanish API like this:

SayanVanishAPI.getInstance();

Or you can use a platform-specific user type like this:

SayanVanishAPI<BukkitUser>.getInstance();

Or like this:

SayanVanishBukkitAPI.getInstance();

From this class, you can access and modify everything. For example, to add a new user:

SayanVanishAPI.getInstance().addUser(User);

Or to access the database directly:

SayanVanishAPI.getInstance().getDatabase();

Events

There are two Bukkit-specific events you can use: BukkitUserVanishEvent and BukkitUserUnVanishEvent. Both events contain the user and vanish options.


For further details and advanced configurations, please refer to the subsequent sections.

PreviousHow It Works?NextEvents

Last updated 10 months ago