Skip to content

Depending on pre‐built PacketEvents

retrooper edited this page Dec 10, 2024 · 13 revisions

How to depend on a pre-built PacketEvents jar

Step 1 - Download PacketEvents

Option 1: Download the latest release on Modrinth
Option 2: Download our development builds on Jenkins

Step 2 - Get the Maven/Gradle dependency

Using Maven

Add this repository to your pom.xml

<repository>
    <id>codemc-releases</id>
    <url>https://repo.codemc.io/repository/maven-releases/</url>
</repository>
<repository>
    <id>codemc-snapshots</id>
    <url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>

Add the packetevents dependency to your pom.xml.
Replace PLATFORM with the platform you are developing for. (For example spigot or bungeecord)

<dependency>
    <groupId>com.github.retrooper</groupId>
    <artifactId>packetevents-PLATFORM</artifactId>
    <version>2.7.0</version>
    <scope>provided</scope>
</dependency>

Using Gradle

Add this repository to your build.gradle

maven { url = uri("https://repo.codemc.io/repository/maven-releases/") }
maven { url = uri("https://repo.codemc.io/repository/maven-snapshots/") }

Add the packetevents dependency to your build.gradle
Replace PLATFORM with the platform you are developing for. (For example spigot or bungeecord)

compileOnly 'com.github.retrooper:packetevents-PLATFORM:2.7.0'

Step 3 - Depend on PacketEvents in your plugin.yml

depend:
- packetevents