Skip to content
RazorPlay01 edited this page May 14, 2025 · 2 revisions

Setup

This guide explains how to set up the Minecraft Networking API in your project.

Prerequisites

  • Minecraft Version: 1.20.5 or later.
  • Dependencies:
    • Guava (for ByteArrayDataInput and ByteArrayDataOutput).
    • SLF4J (for logging).
    • For Fabric: Fabric API.
  • Environment: Paper server, Fabric client, or mixed setup.

Adding the API as a Dependency

The API is hosted on JitPack. Add it to your project as follows:

Maven

  1. Add the JitPack repository to your pom.xml:
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
  2. Add the API dependency:
    <dependencies>
        <dependency>
            <groupId>com.github.RazorPlay01</groupId>
            <artifactId>PacketHandler</artifactId>
            <version>1.1.0</version>
        </dependency>
    </dependencies>

Gradle

  1. Add the JitPack repository to your build.gradle:
    repositories {
        maven { url 'https://jitpack.io' }
    }
  2. Add the API dependency:
    dependencies {
        implementation 'com.github.RazorPlay01:PacketHandler:1.1.0'
    }

Fabric-Specific Configuration

To ensure the API is included in the compiled Fabric mod, add the include directive in your build.gradle:

dependencies {
    modImplementation 'net.fabricmc:fabric-api:0.92.0+1.20.5'
    implementation 'com.github.RazorPlay01:PacketHandler:1.1.0'
    include 'com.github.RazorPlay01:PacketHandler:1.1.0'
}

Manual Installation

Alternatively, clone the API repository and include the packet_handler package in your project:

git clone https://github.com/RazorPlay01/PacketHandler.git

Copy the com.github.razorplay.packet_handler package into your project’s source directory.

Clone this wiki locally