Skip to content
Jan edited this page Jun 18, 2024 · 33 revisions

Welcome to the InvSee++ wiki!

This is where you can find information on the InvSee++ API. This wiki contains code examples and how-tos. Note that the API is licensed under the LGPLv2.1, meaning it is free to use, modify and distribute. Using the API from your own plugin does not require you to adopt the same license. 😄

InvSee++ is available as a Maven dependency via Repsy or GitHub Packages. Note that the use of GitHub Packages requires that you set up authentication. If you're using Maven you can add the following to your pom.xml:

<repositories>
    <!-- other repositories... -->

    <!-- snapshots repository -->
    <repository>
        <id>jannyboy11-repsy</id>
        <url>https://repo.repsy.io/mvn/jannyboy11/minecraft</url>
    </repository>

    <!-- releases repository -->
    <repository>
        <id>github-jannyboy11-invsee++-repo</id>
        <url>https://maven.pkg.github.com/Jannyboy11/InvSee-plus-plus</url>
    </repository>
</repositories>

<dependencies>
    <!-- other dependencies... -->
    <dependency>
        <groupId>com.janboerman.invsee</groupId>
        <artifactId>invsee-plus-plus_plugin</artifactId>
        <version>0.29.1-SNAPSHOT</version> <!-- Note: omit '-SNAPSHOT' suffix when using the releases repository -->
        <scope>provided</scope>
    </dependency>
</dependencies>

Javadocs for the InvSee++ API is available on GitHub Pages.

Getting your instance of the API

In your plugin.yml add InvSee++ to the list of dependencies:

depend:
  - InvSeePlusPlus

In your onEnable, obtain the InvSee++ plugin instance and get the API instance:

package com.example;

import com.janboerman.invsee.spigot.api.InvseePlusPlus;
import com.janboerman.invsee.spigot.api.InvseeAPI;

import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        InvseePlusPlus invseePlusPlus = (InvseePlusPlus) getServer().getPluginManager().getPlugin("InvSeePlusPlus");
        InvseeAPI invseeApi = invseePlusPlus.getApi();

        //do more stuff: configuration, commands, event listeners, bukkit runnables, etc.
    }

}