Files
GeyserWebsite/_docs/geyser/getting-started-with-the-api.md
T
qscbm187531andrtm516 e173c06eb9 Fix hyperlinks and update some descriptions. (#193)
* Fix hyperlinks in custom-skulls.md

* Fix hyperlinks in toc.yml.

* Update extensions.md

* Update api.md

* Fix word errors

* Update geyser api version

* Update api.md

* Add a limitations

* Update api.md

* Update api.md

* Update _docs/geyser/api.md

Co-authored-by: rtm516 <rtm516@users.noreply.github.com>

---------

Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2023-09-07 13:51:52 +02:00

1.7 KiB

title
title
Getting Started with the API

To start, add the Open Collaboration repository to your project:

Maven

<repository>
    <id>opencollab-snapshot</id>
    <url>https://repo.opencollab.dev/main/</url>
</repository>

The "main" repository contains both release and snapshot versions.

Gradle

repositories {
    maven {
        url = uri("https://repo.opencollab.dev/main/")
    }
}

Using Geyser

Add Geyser's API codebase as a dependency:

Maven

<dependency>
    <groupId>org.geysermc.geyser</groupId>
    <artifactId>api</artifactId>
    <version>2.2.0-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

Gradle

dependencies {
    compileOnly('org.geysermc.geyser:api:2.2.0-SNAPSHOT')
}

To get a Geyser player, or check if a player is from Bedrock:

GeyserConnection connection = GeyserApi.api().connectionByUuid(uuid);

connection can be null if such a player does not exist on Geyser.

GeyserApi.api() may be null until after the Geyser plugin enables.

For more information on the Geyser API, see here.

Using Floodgate

This page has a very simple primer for the Floodgate API. For a full breakdown, see here.

Add Floodgate's API as a dependency:

Maven

<dependency>
    <groupId>org.geysermc.floodgate</groupId>
    <artifactId>api</artifactId>
    <version>2.2.2-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

Gradle

dependencies {
    compileOnly('org.geysermc.floodgate:api:2.2.2-SNAPSHOT')
}

Get the Floodgate API using:

FloodgateApi api = FloodgateApi.getInstance();
api.isFloodgatePlayer(uuid);

For more information on the Floodgate API, see here.