Skip to content

bedrock-v/protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protocol

A Minecraft: Bedrock Edition network protocol implementation in V.

Dependency: nbt

This project consumes the standalone network-NBT codec from bedrock-v/nbt via import nbt. Install it into your V module path before building:

git clone https://github.com/bedrock-v/nbt ~/.vmodules/nbt

Build and Run

v -shared -skip-unused .          # compile the library
v -path 'src|@vlib|@vmodules' run examples/roundtrip.v

Usage

import protocol
import serializer

pkt := &protocol.RequestNetworkSettingsPacket{
	protocol_version: protocol.current_protocol
}
bytes := protocol.encode_packet_to_bytes(pkt)

mut pool := protocol.new_packet_pool()
mut r := serializer.new_reader(bytes)
decoded := pool.decode(mut r)!

About

A protocol library written in V for Minecraft: Bedrock Edition

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages