Getting Started
Overview
This method involves manually constructing JSON objects using a JSON library (e.g., Gson) and then converting these objects into byte arrays for transmission. It allows for dynamic and programmatic construction of JSON objects, offering flexibility in modifying the JSON structure. Available fields for each message, including their types, are available on the Buf Schema Registry at https://buf.build/lunarclient/apollo (opens in a new tab).
While constructing messages, note that the @type
field isn't required if the message is being sent within a message.
Note that this method uses a different plugin channel for sending packets,
which is apollo:json
, while still using the lunar:apollo
for player detection.
Integration Examples
🔗 Sending Apollo packets & Enabling Apollo modules
🔗 Detecting players using LunarClient
🔗 Common Apollo Objects
🔗 Adventure Util
For examples of module integration, refer to the specific Module pages. Each page contains code samples under the Manual JSON Object Construction
tab. For instance, you can find sample code for the BorderModule
on its dedicated page BorderModule in the Sample Code
section.