All Projects → CloudburstMC → Protocol

CloudburstMC / Protocol

Licence: apache-2.0
A protocol library for Minecraft Bedrock Edition

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Protocol

Geyser
A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
Stars: ✭ 2,851 (+1839.46%)
Mutual labels:  minecraft, protocol
Gophertunnel
Toolbox for Minecraft software written in Go
Stars: ✭ 156 (+6.12%)
Mutual labels:  minecraft, protocol
Flying Squid
Create Minecraft servers with a powerful, stable, and high level JavaScript API.
Stars: ✭ 311 (+111.56%)
Mutual labels:  minecraft, protocol
Minestat
📈 A Minecraft server status checker
Stars: ✭ 168 (+14.29%)
Mutual labels:  minecraft, protocol
Quarry
Python library that implements the Minecraft network protocol and data types
Stars: ✭ 182 (+23.81%)
Mutual labels:  minecraft, protocol
BedrockProxy
Allow Minecraft Bedrock players on your BungeeCord server!
Stars: ✭ 16 (-89.12%)
Mutual labels:  minecraft, protocol
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (+374.15%)
Mutual labels:  minecraft, protocol
Node Lifx
Node.js implementation of the LIFX LAN protocol 💡
Stars: ✭ 137 (-6.8%)
Mutual labels:  protocol
Gamocosm
Honest Minecraft server hosting
Stars: ✭ 139 (-5.44%)
Mutual labels:  minecraft
Openvehiclediag
A rust based cross-platform ECU diagnostics and car hacking application, utilizing the passthru protocol
Stars: ✭ 135 (-8.16%)
Mutual labels:  protocol
Viabackwards
Allows the connection of older clients to newer server versions for Minecraft servers.
Stars: ✭ 135 (-8.16%)
Mutual labels:  minecraft
Docker Spigot
A docker container with spigot, builds spigot.jar on first start
Stars: ✭ 137 (-6.8%)
Mutual labels:  minecraft
Thaumictinkerer
A Spiritual Successor to the Elemental Tinkerer mod. This time Thaumcraft flavoured.
Stars: ✭ 141 (-4.08%)
Mutual labels:  minecraft
Faithful
Faithful x32
Stars: ✭ 137 (-6.8%)
Mutual labels:  minecraft
Spec
[OLD!] RGB Protocol specifications for Bitcoin-based digital assets
Stars: ✭ 145 (-1.36%)
Mutual labels:  protocol
Paper
Lightning Network Paper
Stars: ✭ 136 (-7.48%)
Mutual labels:  protocol
Crafttweaker
Tweak your minecraft experience
Stars: ✭ 146 (-0.68%)
Mutual labels:  minecraft
Nucleus
The Ultimate Essentials Plugin for Sponge.
Stars: ✭ 144 (-2.04%)
Mutual labels:  minecraft
Commandbook
General and administrative commands
Stars: ✭ 139 (-5.44%)
Mutual labels:  minecraft
Mcreator
MCreator is a software used to make Minecraft Java Edition mods, Bedrock Edition Add-Ons, and data packs using visual graphical programming or integrated IDE. It is used worldwide by Minecraft players, aspiring mod developers, for education, online classes, and STEM workshops.
Stars: ✭ 139 (-5.44%)
Mutual labels:  minecraft

Protocol

License Build Status Discord

Introduction

A protocol library for Minecraft that supports multiple versions. (Currently Bedrock Edition only)

Links

Usage

Client

Creating a client
// This is the local address to bind to, not the remote one.
// If bound to 127.0.0.1 any incoming packets from outside your computer will not be received.
InetSocketAddress bindAddress = new InetSocketAddress("0.0.0.0", 12345);
BedrockClient client = new BedrockClient(bindAddress);

// Bind the port
client.bind().join();
Pinging a Remote Server

This can be done whilst the client is connected to a server however it cannot be to the connected server.

InetSocketAddress addressToPing = new InetSocketAddress("play.nukkitx.com", 19132);
client.ping(addressToPing).whenComplete((pong, throwable) -> {
    if (throwable != null) {
        // Error occurred or timeout
        return;
    }
    // Pong received.
}).join(); // Join if you do not want this to be handled asynchronously.
Connecting to a Remote Server

A BedrockClient can only have one session per instance. If you need more, create extra instances.

InetSocketAddress addressToConnect = new InetSocketAddress("play.nukkitx.com", 19132);
client.connect(addressToConnect).whenComplete((session, throwable) -> {
    if (throwable != null) {
        // Unable to establish connection
        return;
    }
    // Connection established
    // Make sure to set the packet codec version you wish to use before sending out packets
    session.setPacketCodec(Bedrock_v389.V389_CODEC);
    // Add disconnect handler
    session.addDisconnectHandler((reason) -> System.out.println("Disconnected"));
    // Remember to set a packet handler so you receive incoming packets
    session.setPacketHandler(new FooBarPacketHandler());
    // Now send packets...
}).join(); // Join if you do not want this to be handled asynchronously.

Server

Creating a Server
InetSocketAddress bindAddress = new InetSocketAddress("0.0.0.0", 19132);
BedrockServer server = new BedrockServer(bindAddress);

BedrockPong pong = new BedrockPong();
pong.setEdition("MCPE");
pong.setMotd("My Server");
pong.setPlayerCount(0);
pong.setMaximumPlayerCount(20);
pong.setGameType("Survival");
pong.setProtocolVersion(Bedrock_v389.V389_CODEC.getProtocolVersion());

server.setHandler(new BedrockServerEventHandler() {
    @Override
    public boolean onConnectionRequest(InetSocketAddress address) {
        return true; // Connection will be accepted
    }
    
    @Override
    public BedrockPong onQuery(InetSocketAddress address) {
        return pong;
    }
    
    @Override
    public void onSessionCreation(BedrockServerSession serverSession) {
        // Connection established
        // Add disconnect handler
        session.addDisconnectHandler((reason) -> System.out.println("Disconnected"));
        // Remember to set a packet handler so you receive incoming packets
        session.setPacketHandler(new FooBarPacketHandler());
        // By default, the server will use a compatible codec that will read any LoginPacket.
        // After receiving the LoginPacket, you need to set the correct packet codec for the client and continue. 
    }
});

// Start server up
server.bind().join();

Maven

Protocol Versions:
Dependency Minecraft Version
bedrock-v291 1.7.0
bedrock-v313 1.8.0
bedrock-v332 1.9.0
bedrock-v340 1.10.0
bedrock-v354 1.11.0
bedrock-v361 1.12.0
bedrock-v388 1.13.0
bedrock-v389 1.14.0 - 1.14.50
bedrock-v390 1.14.60
bedrock-v407 1.16.0 - 1.16.10
bedrock-v408 1.16.20
bedrock-v419 1.16.100
bedrock-v422 1.16.200 - 1.16.201
bedrock-v428 1.16.210
Repository:
    <repositories>
        <repository>
            <id>nukkitx-repo-release</id>
            <url>https://repo.nukkitx.com/maven-releases/</url>
        </repository>
        <repository>
            <id>nukkitx-repo-snapshot</id>
            <url>https://repo.nukkitx.com/maven-snapshots/</url>
        </repository>
    </repositories>
Dependencies:
    <dependencies>
        <dependency>
            <groupId>com.nukkitx.protocol</groupId>
            <artifactId>bedrock-v(VERSION)</artifactId>
            <version>2.6.3-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

Projects Using This Library

If you would like to add your project here, please create a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].